1

I want to upload a bigger file (6 MB) with GWT upload. By default it allows only files with a maximum size of ~3 MB. Therefore I adjusted my web.xml with the following context params:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
    <context-param>
        <param-name>maxSize</param-name>
        <param-value>102400000</param-value>
    </context-param>


    <context-param>
        <!-- max size of any uploaded file -->
        <param-name>maxFileSize</param-name>
        <param-value>102400000</param-value>
    </context-param>

But nevertheless I get the following error:

2015-07-23 22:26:05 ERROR UploadServlet:70 - UPLOAD-SERVLET (0d0quwXW6dcRxDl_G4ZHag) getUploadStatus: GWTU-019405167154036462 finished with error: The request was rejected because its size: 6.054 KB, exceeds the maximum: 3.071 KB

My code runs on app engine and my upload action extends AppEngineUploadAction

public class MyUploadAction extends AppEngineUploadAction

In my upload action I even overrode the method "checkRequest" to do nothing, but it did not help either

@Override
public void checkRequest(HttpServletRequest request) {
    logger.info("Skip all checks completly");
}

What am I doing wrong and how can I enable my app for bigger files with GWT upload?

jan
  • 3,923
  • 9
  • 38
  • 78
  • Have you found a solution? I want to limit the file size, but the context params are not doing anything. – Kayz Jan 07 '16 at 18:46
  • @Kayz I ended up extending UploadAction, overriding "checkRequest()" and setting "maxSize" to a custom value. Not a nice solution, but it works – jan Jan 07 '16 at 21:21

1 Answers1

0

Just checked, for me - changing this parameter works fine:

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