We're using Struts 1.2.9 and the problem we're seeing is that if a user tries to upload a file that does not exist or upload a file that exceeds the maxFileSize attribute the FormFile object on the ActionForm is null and so we cannot distinguish between the two.

We thought about removing the maxFileSize parameter and doing the check ourselves in the ActionForm, but it appears that the file upload has already begun at that point and while we can look at the Content-Length header from the HttpServletRequest object in the Struts Action, it's a moot step because the file has already begun to upload.

Is there a method on Action or DispatchAction (or perhaps something else) that we can override to prevent the file upload if it exceeds a size we determine? My concern is that Apache commons-fileupload gets the request to upload the file first before Struts gets it and we might be hozed in this regard.

Any thoughts?  Thanks.

--adam

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to