javamultipart

Is there a limit for the file size when sending MultiPart Rest call with Java (not with Spring)?


Is there a limit for the file size when sending MultiPart Rest call with Java (not with Spring)?

We have a code, similar to this one: (same implementation, using 'HttpURLConnection' and 'OutputStream') https://www.codejava.net/java-se/networking/upload-files-by-sending-multipart-request-programmatically

Maybe the limitation is the 'OutputStream' size limit?

would appreciate your help, thanks!

I've tried to upload big files, but I couldn't find a server that will get more than 10MB. Also tried to understand which Java Object is my bottleneck and got confused . . .


Solution

  • In general the max size of a request (e.g. POST) can either be controlled by the container/server (e.g. Tomcat) or the application. The default behavior for containers vary, refer default for Tomcat. In addition, applications may also impose a size limit. Limiting size for uploads is in general a common feature to limit security related incidents.

    If you have access to the servers and the applications you could check their configurations.