Set Max File size for File Upload

View: New views
2 Messages — Rating Filter:   Alert me  

Set Max File size for File Upload

by ddduuu () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, all,

Is there a way to set maximum file size for uploading? in FileUploadBaseclass of commons fileupload library, it provides a method setFileSizeMax(long size), this can only be called from DWR CommonsFileUpload class, if we use dwr library, I donot see a way to set max size outside of DWR by calling DWR API or configure in web.xml. Currently the default max size from the commons fileupload library is used.

Thanks for your attention.

Dave


Re: Set Max File size for File Upload

by ddduuu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Joe and all,
After hours testing, I found out even I set the maximum size by calling setFileSizeMax() and setSizeMax() on ServletFileUpload object from inside parseRequest() of CommonsFileUpload class, sending a big file like 20MB (smaller than the max size I set) will not work, the call to upload(FileTransfer file) made from dwr javascript never comes to the server java side, and it just hangs inside DWR somewhere and never comes back. if I upload a smaller file less than 15MB, then the upload will be successful except the progress bar does not work properly because it does not return status when the upload is in progress, and only returns status when the upload process is done.

Since Joe is the core developer of this functionality, is there a chance for you to look at these issues? and also you can give me a clue so I know where to start to look at them.

Thanks very much for your contribution to DWR, I really like it.

Dave


ddduuu wrote:
Hi, all,

Is there a way to set maximum file size for uploading? in FileUploadBaseclass of commons fileupload library, it provides a method setFileSizeMax(long size), this can only be called from DWR CommonsFileUpload class, if we use dwr library, I donot see a way to set max size outside of DWR by calling DWR API or configure in web.xml. Currently the default max size from the commons fileupload library is used.

Thanks for your attention.

Dave