• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Uplaoding problem needs help

 
rahul cong
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • 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
  • 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: 1691
10
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic