commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mitra, Anirban" <anirban.mi...@fmr.com>
Subject [fileupload]
Date Thu, 26 Jan 2012 22:14:07 GMT
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



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message