I use the Apache commons fileupload 1.4 library in my java project. I have a html part with a classic form with a file input and some hidden fields.
I have a problem with uploading files of around >500ko only with Firefox >= 52
It works well with files of 10mo in Chrome or Internet Explorer. But with Firefox, I have a timeout after waiting several minutes after submitting the form.
After some debugging, I see that the code responsible of the timeout is :
List<FileItem> items = (new ServletFileUpload(new DiskFileItemFactory())).parseRequest(request);
The part with cause wait is "parseRequest".
I try to debug the content of request with debugger in IntelliJ, but there is no way to copy entire content value of this request object in raw format.
It's working in these cases : - Firefox : version <= 52 or file size < 500ko (around, it's not really precise) - Internet Explorer - Chrome
There is no file size limit, it seems that depends on the request size, because the parsing request part is taking too much time...
I get the HTTP request with a Firefox extension in two cases. One generating uploading a file of 3mo which doesn't works (the request file is huge, 3x the size of the uploaded file) : https://code.empreintesduweb.com/13561.html
One generated uploading a file of 200ko which works (the request file is small) : https://code.empreintesduweb.com/13560.html
In fact, the main difference is that in Chrome or IE, I don't have the raw content of the uploaded file in the request headers :
The part with : obj stream .... endstream endobj
Only appear with Firefox...