aspose file tools*
The moose likes Struts and the fly likes [Help, File Upload encounter OutOfMemoryError] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[Help, File Upload encounter OutOfMemoryError]" Watch "[Help, File Upload encounter OutOfMemoryError]" New topic
Author

[Help, File Upload encounter OutOfMemoryError]

Richard Chiu
Greenhorn

Joined: Dec 20, 2004
Posts: 1
Recently, I am writing a page which requires to upload a file.
I have added the attribute for <html:form method="post" enctype="multipart/form-data">.

Everything was fine when the first time i opened this page, but a problem encountered when i clicked the button and submited this form to the back-end. An OutOfMemoryError exception occured at ByteArrayOutputStream.class

In addition, this page carrys lots of hidden attribute and data.
if i dont set the enctype="multipart/form-data", the problem wont occur.
However, i need that upload file.

I wonder it is struts' limitation?
if so, does anyone have a solution for this?

The problem seems occurs because enctype="multipart/form-data" will enctype all data at this page into byte and then it brust the heap memory.
[ December 20, 2004: Message edited by: Richard Chiu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Help, File Upload encounter OutOfMemoryError]