GWTUpload -最大文件大小上下文参数不工作



我想用GWT上传一个更大的文件(6 MB)。默认情况下,它只允许最大大小约3 MB的文件。因此,我用以下上下文参数调整了我的web.xml:

<?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>

但是我得到了以下错误:

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

我的代码运行在应用引擎和我的上传动作扩展AppEngineUploadAction

public class MyUploadAction extends AppEngineUploadAction

在我的上传操作中,我甚至覆盖了方法"checkRequest"来不做任何事情,但它也没有帮助

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

我做错了什么,我怎么能使我的应用程序为更大的文件与GWT上传?

刚刚检查,对我来说-改变这个参数工作良好:

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

相关内容

  • 没有找到相关文章

最新更新