aspose file tools*
The moose likes JSP and the fly likes File Uplaoding problem needs help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "File Uplaoding problem needs help" Watch "File Uplaoding problem needs help" New topic
Author

File Uplaoding problem needs help

rahul cong
Greenhorn

Joined: Jan 21, 2011
Posts: 2
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

Joined: Jul 06, 2005
Posts: 1018
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

Joined: Jan 21, 2011
Posts: 2
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

Joined: Jul 06, 2005
Posts: 1018
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File Uplaoding problem needs help