1

I've seen this question asked a couple of times a long while back but haven't seen a solid answer so I was hoping to get a bit more information.

I am working with the GWT UploadServlet and running into the issue where the 512 KB file limit is reached. I've tried adding the context params for maxSize and maxFileSize into my web.xml to no avail.

<context-param>
    <!-- max size of the upload request -->
    <param-name>maxSize</param-name>
    <param-value>10240000</param-value>
</context-param>

<context-param>
    <!-- max size of the upload request -->
    <param-name>maxFileSize</param-name>
    <param-value>10240000</param-value>
</context-param>

The UploadServlet still initializes on startup with the 512 KB limit it defaults to. Does anyone have any idea how to get this working correctly?

Carlos Cavero
  • 3,011
  • 5
  • 21
  • 41
Jason King
  • 11
  • 1
  • What do you mean by "GWT UploadServlet"? As far as I can tell, there isn't a class called "UploadServlet" shipped as a part of GWT. What is the full package of that class? – Colin Alworth Mar 08 '19 at 04:53
  • https://github.com/mwl/gwt-upload/blob/master/core/src/main/java/gwtupload/server/UploadServlet.java And looks like default limit is 5mb, so maybe is your server configuration the one you need to change. – Ignacio Baca Mar 08 '19 at 06:38

1 Answers1

2

Don't.

Seems like you are using gwt-upload, which looks like an old and unmaintained piece of software.

I would strongly suggest to take advantage of the Servlet 3.0/3.1 specs and simply post the file from the client and let the server do the dirty work.

Here there is a full explanation with examples: https://stackoverflow.com/a/2424824/2858092

Luigi Polvani
  • 405
  • 5
  • 9