• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File Uplaoding problem needs help

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I am not able to upload a file using deployment link. Basically my project upload a .csv file and stored the content in database. It is working fine in my local workspace but not working in deployment region.In local we are using Jboss in deployment we have websphere.we are using struts 1.2 and jsp.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saying "It doesn't work" doesn't help.


What about it doesn't work?
Do you get an error message? What is it? Stacktrace? What is in the logs?
What does your code look like?
Help us to help you.

I presume you are using an <input type="file"/> control on the page, and then using a library similar to the Apache FileUpload?
If you use the java.io.File class to "upload" the file from the filesystem you are completely wrong.
 
rahul cong
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My code is something like

<form name="fileupload" enctype="multipart/form-data" method="post"
action="/photos/fileuploadresult">
<tr>
<td >Photo 1</td>
<td ><input type="file" name="uploads[0]" /></td>
</tr> pload
<tr>
<td >Photo 2</td>
<td ><input type="file" name="uploads[1]" /></td>
</tr>
<tr>
<td>
<input type='submit' name="submit" value="Submit">
</td>
<tr>
</form>

uploadform is like

public class FileUploadForm extends ActionForm {

private List formFiles = new ArrayList(); t

public List getUploads() { return this.formFiles; }

public void setUploads(int iIndex, FormFile formFile){
this.formFiles.add(formFile);
}


I futher debugged the code and found that the input parameter are getting set properly. But it is not getting set in form file my formfile is null It is not getting set properly ..please help

 
Stefan Evans
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My suggestion would be to try a smaller example - with just one upload control rather than multiple, and see if that works.
What version of Websphere are you using?
As always having differences between your local and deployment environments can be a huge pain point.

Maybe you can switch on logging for the org.apache.struts.upload package and get more information about what it is doing differently?
 
Not so fast naughty spawn! I want you to know about
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic