You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Mitra, Anirban" <an...@fmr.com> on 2012/01/26 23:14:07 UTC
[fileupload]
Hello,
I have some question regarding uploading a file below certain file size limit (10 MB).
I am trying to use FileUpload in my project. I am uploading a file which is a formFile using an Ajax submit. On server I do receive the file and able to open the inputStream.
My requirement is to keep the file in memory and read the data and do some processing.
I have another requirement to send error back if the file size is greater than x Mob's I have to put a limit on the file size before I start the processing.
I do see certain functions to set the file size for FileUpload but I am not finding to way to specify a file size limit of 10 MB or so.
I method fileUpload.setFileSizeMax(long fileSize) , check only for "fileSize" number of character not the file size like certain byte.
Is there a way to use FileUploadAPI's to restrict file of some size ? (10 MB)
This is the kind of code I am using.
http://commons.apache.org/fileupload/streaming.html
Appreciate a response from your end.
Thanks
Anirban