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 ]