Adam-

take a look at implementing FileUploadAction
http://jsourcery.com/api/apache/struts/2.0.6/org/apache/struts2/showcase/fil
eupload/FileUploadAction.html

M--
----- Original Message -----
From: "Adam Gordon" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[email protected]>
Sent: Thursday, February 07, 2008 6:35 PM
Subject: File upload issues when maxFileSize is exceeded.


> 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]
>
>


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

Reply via email to