【问题标题】:Uploading huge files (> 2GB) to websphere将大文件 (> 2GB) 上传到 websphere
【发布时间】:2016-02-17 20:22:30
【问题描述】:

我在 websphere 8.5.5 上部署了一个 Web 应用程序,我想上传一个大文件(~3 GB),但我的问题是 content-lengthnull in-case文件大小超过(2GB),尽管当我在 tomcat 上部署相同的应用程序时,一切都按预期工作。

HttpServletRequest httpRequest = (HttpServletRequest) request;
    ServletFileUpload sfu = new ServletFileUpload(new DiskFileItemFactory());

    sfu.setSizeMax(-1);
    httpRequest.getHeader(FileUploadBase.CONTENT_LENGTH); //This returns null for huge files !

【问题讨论】:

  • 您是否使用能够处理 2 个以上 gig 文件的浏览器,以及可以处理相同功能的 webserver+os?
  • 是的,当我们使用 tomcat application-server 时,具有相同浏览器和操作系统的相同应用程序按预期工作

标签: java file jakarta-ee web-applications websphere


【解决方案1】:

这是 WAS 8.5.5 的一个小问题,如果内容长度大于 2GB,httpRequest.getContentLength() 将按预期返回 -1,但 httpRequest.getHeader("Content-Length") 将返回 null。

该问题已通过对 Servlet 3.1 的支持得到解决,该支持已添加到 WebSphere Application Server Liberty 配置文件 8.5.5.4 中,并且也在此处提供的 WebSphere Application Sever V9 beta 中得到解决:https://developer.ibm.com/wasdev/blog/2015/10/17/websphere-application-server-v9-beta/

在 8.5.5 中,您可以通过将内容长度设置为查询参数或将其包含在请求的路径信息中来解决此问题。或者,如果您有支持,您可以联系 IBM 服务以打开 PMR 并请求修复。

【讨论】:

    猜你喜欢
    • 2019-03-24
    • 1970-01-01
    • 2018-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多