I have a simple Java web application that use Ajax image upload using canvas.toDataURL and base64 encoder. Usually it run well, but I have a very weird error that happen intermittently. Somehow my application cannot detect any http request parameters that send by my Ajax requests. After I spend a while researching, it seems that this error only happen when uploading multiple big images.
I add “maxPostSize” property on server.xml, to increase maximum POST size that Apache Tomcat can handle. In this example, i increase it into 20MB.
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" maxPostSize="20971520"/>