Announcement

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

    Uploaded file not in browser F12 tools network tab and general SmartClient File Upload questions

    Hi Isomorphic,

    I need to play around with maximum file sizes on upload serverside and clientside.
    I noticed that I can't see a request in the MB area when uploading a 4MB file in this sample. I tried FF128 and Edge 126 and I could not see a big request in either F12 tools.
    So right now, the upload seems magic to me :) Could you explain how I could see more details here and how it works?

    I already saw that the mechanism is different for FF and Egde, where the latter seems to use a hiddenFrame (from the mentioning of parent.isc.Comm.hiddenFrameReply in the 1st requests response).

    I did read the Upload and Binary Fields docs, but they did not discuss this.

    Also, do I need to set Tomcat's maxPostSize according to SmartClient's DataSourceField.maxFileSize (in case you know this)?

    Thank you & Best regards
    Blama

    #2
    Sorry, we're not sure of the question here - sounds like you can't figure out how to use the browser's built-in tools to view uploads?

    As far as Tomcat's max upload size, yes, if you are trying to upload something larger than Tomcat's max upload size, that will not work, even if you have set SmartClient's max upload size to a larger number. This is because Tomcat gets the request first, and rejects it. Same for any servlet engine / application container.

    Comment


      #3
      Hi Isomorphic,

      yes, that's what I'm saying :) I can't see any big requests for file uploads. This is for a 4MB zip file containing three copies of the Quick Start Guide. There is nothing in the MB area:

      Click image for larger version

Name:	F12 Tools.png
Views:	60
Size:	61.5 KB
ID:	273100

      And regarding maxPostSize: This is what I expected, although I did not manage to break the upload locally with very low numbers. Is there perhaps a way commons-fileupload-1.4.jar or usage of it change/disable this?
      commons-fileupload seems to be necessary for the file upload. Without it you get a server error. I noticed here that it is not in the JavaModuleDependencies docs.

      I do expect the Tomcat values to be the defining ones setting the ground rules and that no application is able to change this. But I just was not able to break FileUpload, so I'm confused here now.

      I tried setting maxPostSize and maxSavePostSize in my Connector. I also tried low values in <multipart-config> in my web.xml for the IDACall servlet, which seems to handle the upload (see the long top bar in the screenshot).


      Best regards
      Blama

      Comment


        #4
        There doesn't seem to be anything we can help with here..

        Depending on your settings, file upload may be accomplished as a form post or as an XMLHttpRequest upload. These would appear in different places in different browser tools, and it's probably best to use ChatGPT to help navigate this if you're not find the upload data.

        As far as the Tomcat connector, setting a maximum upload size there definitely works, as we've had around 10 times where we've had to explain to people that Tomcat has these settings and that's why their upload is not working. You might be tying to change the setting in the wrong portion of the file, or it could be something silly like forgetting to restart Tomcat after changing the setting, or editing Tomcat config for the wrong Tomcat instance, etc.

        Comment


          #5
          Hi Isomorphic,

          this is really so weird. I can get the whole application to fail, if I set super low numbers like maxPostSize="1024" maxSavePostSize="1024", as then the "normal" application requests to IDACall fail. Then I see this in my server log (expected):
          Code:
          2024-07-30 13:39:57,715 WARN com.iso.rpc.RPCManager [https-openssl-nio-443-exec-2] Unexpected empty RPCManager transaction: POST'd data appears to have been removed from the request before the server framework received it. This may be due to application / server settings restricting maximum POST / file upload size, or due to security software on your server, browser or network that erroneously blocked the request, or due to bugs in servlet filters. Please see the documentation for isc.RPCResponse.STATUS_MAX_POST_SIZE_EXCEEDED
          2024-07-30 13:39:57,715 ERROR com.lms.lms.ser.LMSIDACall [https-openssl-nio-443-exec-2] com.lmscompany.lms.server.LMSIDACall top-level exception
          com.isomorphic.rpc.ClientMustResubmitException:
              at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2580) ~[isomorphic_core_rpc.jar:?]
              at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:484) ~[isomorphic_core_rpc.jar:?]
              at com.lmscompany.lms.server.LMSIDACall.processRequest(LMSIDACall.java:37) [classes/:?]
              at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119) [isomorphic_core_rpc.jar:?]
              at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79) [isomorphic_core_rpc.jar:?]
          ...
          ...
          ...
          If I set it to maxSavePostSize="65536" maxPostSize="65536", my application works (expected) but my Upload of big files (17MB) also works (unexpected). With this, I know for sure I'm editing the right file and do a restart etc.

          I also have the default Tomcat Manager deployed, and if you search for too big requests and problems with these, it comes up a lot, as people want to deploy big wars and this does not work because of the default <multipart-config> in Tomcat Manager's web.xml. I can also not deploy big wars with it, so the multipart-config is working as well. Exception then (expected):
          Code:
          Jul 30, 2024 1:55:21 PM org.apache.catalina.core.ApplicationContext log
          SCHWERWIEGEND: HTMLManager: FEHLER - Hochladen zur Installation fehlgeschlagen, Ausnahme: [org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (75231440) exceeds the configured maximum (52428800)]
          java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (75231440) exceeds the configured maximum (52428800)
              at org.apache.catalina.connector.Request.parseParts(Request.java:2913)
              at org.apache.catalina.connector.Request.parseParameters(Request.java:3202)
              at org.apache.catalina.connector.Request.getParameter(Request.java:1124)
              at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)
              at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:141)
          ...
          ...
          ...
          I also have a <multipart-config> for the IDACall servlet (or rather my subclass of it) in my web.xml – also no effect.

          So I'm really confused why my upload limits are not being respected. I also tested the files, just to be sure: the files are correctly uploaded. Downloading them again and comparing them to the original shows this.

          I know there is not a lot you can do here, but could you try setting a bigger limit than what your Showcase Application Server's maxPostSize is in mediaLibrary.ds.xml of the Upload sample and see if uploading a bigger file works for you?

          In the meantime I'll try to find out what requests exactly my Browser is sending on Upload and what happens if I try uploading a file to a maxPostSize="1" when I do this in an already open application window (as the application does not start with this, see above).

          Thank you & Best regards
          Blama

          Comment


            #6
            Since what's going on here is that you can't get Tomcat to respect limits on uploads, while in the meantime SmartGWT's settings are working fine, it's probably best to seek help in a Tomcat forum.

            Comment

            Working...
            X