commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Hermanson <e...@alum.mit.edu>
Subject FileUploadBase.setFileSizeMax & MultipartStream.ItemInputStream.makeAvailable()
Date Thu, 30 Aug 2007 03:04:21 GMT
setFileSizeMax is apparently intended to prevent the file upload if  
the file about to be uploaded is larger than a given size.  However,  
the exception does not get processed until AFTER the entire file is  
uploaded to the server (thereby defeating the purpose of the limit).   
I went into the debugger and noticed that

	MultipartStream.ItemInputStream.close()

is calling

	MultipartStream.ItemInputStream.makeAvailable()

and the call to InputStream.read() in that method is actually what's  
causing the entirety of the oversized file upload data to be  
incorrectly read.  The FileUploadBase.FileSizeLimitExceededException  
is correctly being raised, but the subsequent buffer read during  
close is resulting in all of the data being read regardless.  This  
seems like a bug to me, but I am not all that familiar with the code.




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


Mime
View raw message