wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "File Uplaoding problem needs help" Watch "File Uplaoding problem needs help" New topic

File Uplaoding problem needs help

rahul cong

Joined: Jan 21, 2011
Posts: 2

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

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

Joined: Jan 21, 2011
Posts: 2
My code is something like

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

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){

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

Joined: Jul 06, 2005
Posts: 1016
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?
subject: File Uplaoding problem needs help
Similar Threads
Displaying image problem
HTTPS File Uploader
execute ftp commands using java API
how to upload a file usiing jsp/servlets
uploading servlet