You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2019/09/27 12:34:00 UTC
[jira] [Commented] (FILEUPLOAD-301) Problems uploading files
greater than 100kb using HTTPS
[ https://issues.apache.org/jira/browse/FILEUPLOAD-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16939394#comment-16939394 ]
Michael Osipov commented on FILEUPLOAD-301:
-------------------------------------------
Tomcat and HttpComponents committer here. I highly doubt that there is a bug in FileUpload. It is likely your setup or client. Write a simple servlet which persists the request body into a stream. Also retry with curl and HttpClient. Provide both cases with debug/verbose log output.
> Problems uploading files greater than 100kb using HTTPS
> -------------------------------------------------------
>
> Key: FILEUPLOAD-301
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-301
> Project: Commons FileUpload
> Issue Type: Bug
> Affects Versions: 1.2.2, 1.4
> Environment:
> Apache Tomcat 8.5
> java 9.0.4
> Windows Server 2016 Datacenter
> Reporter: Andrea
> Priority: Major
>
> I'have a java web app that uses Apache Commons FileUpload for uploading files using servlets.
> My base code worked perfectly for years on a plain http environment (Apache Tomcat 8.5).
> I've changed my environment to work with HTTPS, using a Let's Encrypt certificate using connector configured with org.apache.coyote.http11.Http11AprProtocol.
> My uploads now suddenly fail if files are greater than 100kb. Same files uploaded successfully using plain HTTP environment.
> This is the exception logged:
>
> {{org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. java.io.IOException: The socket [925,024,592] associated with this connection has been closed.}}
> this is the code fragment i use for manage request:
>
> {{DiskFileItemFactory factory = new DiskFileItemFactory(); }}
> {{File repository = (File) request.getServletContext().getAttribute("javax.servlet.context.tempdir"); factory.setRepository(repository); }}
> {{ServletFileUpload upload = new ServletFileUpload(factory); upload.setHeaderEncoding(encoding); }}
> {{multipartItems = upload.parseRequest(request);}}
>
> Tomcat settings:
>
> {{<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />}}
> {{}}
> {{<Connector port="443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true" > }}
> {{<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <SSLHostConfig> }}
> {{<Certificate certificateKeyFile="D:/prj/certificati/private.key" certificateFile="D:/prj/certificati/certificate.crt" certificateChainFile="D:/prj/certificati/ca_bundle.crt" type="RSA" /> }}
> {{</SSLHostConfig> }}
> {{</Connector>}}
> Thanks
--
This message was sent by Atlassian Jira
(v8.3.4#803005)