Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Max file size

    I am trying to set a max upload file setting server.properties with: fileUpload.maxFileSize: 10485760 as shown here: https://www.smartclient.com/smartgwt...cs/Upload.html

    When I try to save a larger file, I get this exception:
    Code:
    === 2016-05-04 10:41:46,175 [ec-3] WARN  RPCManager - Transaction 26 aborted.  Caused by:
    org.apache.commons.fileupload.FileUploadBase$FileSizeLimitExceededException: The field f_unterschrift exceeds its maximum permitted size of 10485760 bytes.
        at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl$FileItemStreamImpl$1.raiseError(FileUploadBase.java:787)
        at org.apache.commons.fileupload.util.LimitedInputStream.checkLimit(LimitedInputStream.java:78)
        at org.apache.commons.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:137)
        at java.io.FilterInputStream.read(FilterInputStream.java:107)
        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:100)
        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:70)
        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:347)
        at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)
        at com.isomorphic.servlet.ISCHttpServletRequest.parseRequest(ISCHttpServletRequest.java:277)
        at com.isomorphic.servlet.ISCHttpServletRequest.parseRequest(ISCHttpServletRequest.java:231)
        at com.isomorphic.servlet.ISCHttpServletRequest.getStringParams(ISCHttpServletRequest.java:131)
        at com.isomorphic.servlet.ISCHttpServletRequest.getParameter(ISCHttpServletRequest.java:349)
        at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2127)
        at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:369)
        at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:349)
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:147)
        at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
        at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at de.mks_infofabrik.kids.server.filter.GWTCacheControlFilter.doFilter(GWTCacheControlFilter.java:50)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
    Which seems correct.
    But the answer never returns to the client! The client keeps waiting until a timeout. And when I check the RPC tab, the update never returns, as I expected because of the timeout.
    So how to tell the client that the size exceeded ?

    Using smartgwt 6.0-p20160408 power

    #2
    Set dataSourceField.maxFileSize. The property you're using sets a maximum across all uploads anywhere in the system, so it's really for DDOS defense. Exceeding field.maxFileSize will lead to a normal validation error, and enforcement will actually happen before the browser uploads the file at all (in browsers where that's possible).

    Comment


      #3
      Thank you, this worked.
      Shouldn't this appear in the link I posted? I think this info is missing there

      Comment

      Working...
      X