Hi,
i have been assigned a task to create a simple upload file application using struts in servlets. I have gone thru the file-upload.war in the struts 1.1 webapps folder and made some changes to it.. but i could not save the file i uploaded to disk even though my applications already stated that my upload was successul...
can anyone help me out here... i'm a newbie in training...:D
regards
Jimmy
-
Creating File Upload using servlets: need help (1 messages)
- Posted by: jim wu
- Posted on: April 04 2004 23:23 EDT
Threaded Messages (1)
- Creating File Upload using servlets: need help by Mircea Crisan on April 05 2004 10:41 EDT
-
Creating File Upload using servlets: need help[ Go to top ]
- Posted by: Mircea Crisan
- Posted on: April 05 2004 10:41 EDT
- in response to jim wu
Hi,
When uploading a file, the struts keep sthe upoaded bytes in memory. If the ulpoad content size exceeds a threshold, only then struts saves the upload contnet to the disk. This threshold value is specified by the 'maxFileSize' servlet init parameter of the struts action servlet. However, you should work with the input stream of the FormFile and save the upload content wherever you wan: databse BLOB, file syste, etc. Also don't forget to call the 'destroy()' on your form file aftre your done with the stream.
Best regardds, Mircea