Skip to main content

[webtier] Re: Discard large file upload

1 reply [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

On 05/18/09 05:01 AM, Sanganak-Guru wrote:
> Hi,
>
> I am working on a piece of code related to file upload using struts.
>
> I want to abort/discard a file upload request from browser in case the file
> size being uploaded is larger than what is currently configured.
>
> Is there any way to discard / abort file upload request and show user an
> error in case the file size is larger than configured file size upload
> limit?
>

In earlier GlassFish releases, you would specify the max file-upload size
via the maxPostSize property of (default: 4096).

The upcoming Servlet 3.0 spec, which is implemented by GlassFish v3, adds
server-side support for file-upload, and allows you to specify
(declaratively
via the new , or via the new MultipartConfig annotation)
////////////configuration for multipart/form-data requests, including
the maximum size
of uploaded files and the maximum (total) size of multipart/form-data
requests.
This configuration may be specified on a per-servlet basis (for the
servlet(s)
handling multipart/form-data requests).

Thanks,

Jan

> Thanks in advance,
> -SG
>

[att1.html]