jan
jan

Reputation: 4103

GWTUpload - max file size context param not working

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?

Upvotes: 1

Views: 927

Answers (1)

Maksym Ovsianikov
Maksym Ovsianikov

Reputation: 509

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>

Upvotes: 0

Related Questions