This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Multiple file upload issue... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiple file upload issue..." Watch "Multiple file upload issue..." New topic
Author

Multiple file upload issue...

Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
I have to upload and download mutliple files to and from a database. I am planning to use stuts html-form. I found the following artcile describing an issue with the file-uploading.

http://www.nabble.com/multiple-file-uploads-with-one-property-t4021.html

Any updates / experience on this matter is appreciated.

Thanks in advance to all the concerned experts.


Srini
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Have you tried it? My project has a few pages with multiple file tags and that works fine (I am using Struts 1.1). The bug referenced seems to be related to multiple file tags with the same property name and uploading multiple files with one file tag (I did not know that some browsers supported that...I could not get it to work in IE 6.0).

- Brent
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
I am getting Class Cast Exception with the following code...

<<< Starts here >>>

private String resetFileList(FormFile currentFile, HashMap filesData) {
Iterator it = filesData.keySet().iterator();
StringBuffer fileNames = new StringBuffer();
while (it.hasNext()) {
FormFile tempFile = (FormFile) it.next();
fileNames.append(tempFile.getFileName()).append("\n");
}
return fileNames.toString();
}

<<< ends here >>>>

I am using a html:file in my form. when the user submits the file for upload, in action I am storing the FormFile in to the session and reading adding the new file to the HashMap and setting the HashMap to the session again. This way I keep track of all FormFile objects and push them once, when the user submits the button.

I do not understand why I am getting class cast exception when I am reading the FormFile object from the HashMap i stored to the session.

Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple file upload issue...