commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: [fileupload] File Size Limit Exceeded - Any method for early detection?
Date Mon, 04 Oct 2010 20:55:21 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rob,

On 10/4/2010 1:58 PM, Rob Podolski wrote:
> ServletFileUpload upload = new ServletFileUpload(factory);
> upload.setFileSizeMax(10000000L);
> 
> will only operate AFTER the file has been received in the servlet request.

You could check the Content-Length header of the request (or the request
part). If there is none, you're going to have to wait for the whole file
to be uploaded in order to find out how big it is (or try to bail-out
after you hit a limit, though I'm not sure what options you have via
FileUpload).

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyqPzkACgkQ9CaO5/Lv0PCLxQCgjcdWwD9/nvNsdnaOBnsUXMXw
gs0AniMbQrruQbZEepwO9u0DZkwhK3BW
=d0xb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message