I need to create a web application based on Apache Tomcat, which can receive large (100 MB or more) files via HTTP (multipart form POST request).
I tried Apache Commons Fileupload and it works for smaller files (20-40 MB). But it doesn't work for large files.
Are there any obvious ways to implement large file upload except
- using Java applet at the client side,
- tweaking Tomcat's settings?
Update 1 (03.10.2013): Here's the exception that I get at the server side when uploading 2 files with approx. 120 total size.
Refer here
It can be done using plupload. In case you dont want to use applet, you can use flash,html5 etc.. Any number of files of any size can be uploaded.
If it's a error in tomcat you could increase the maximum upload file size and the maximum request size in your
web.xml
.An example with 50MB max upload:
If you have an apache or nginx infront of your tomcat as proxy, you may have to increase their upload/post size values too in the server config.
Set the
maxPostSize
attribute value of the HTTP connector in your Tomcatserver.xml
config file:Tomcat reference doc: http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Attributes
I found another solution. On the FileUpload's web site there is a page about the Streaming API.
The code snippet on that page solved my problem.