Announcement

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

    file upload problem with Chrome

    SmartClient Version: v12.1p_2022-02-22/Enterprise Development Only (built 2022-02-22)

    Chrome 98.0.4758.102 on MacOS Monterey 12.2

    Hello, please modify the mediaLibrary.ds.xml like this:

    Code:
    <DataSource ID="mediaLibrary" serverType="sql" tableName="mediaLibrary">
        <fields>
            <field name="pk" type="sequence" hidden="true" primaryKey="true"/>
            <field name="title">
            </field>
            <field name="image" type="imageFile" maxFileSize="5242880" required="true">
            </field>
        </fields>
        <operationBindings>
            <operationBinding operationType="add">
                <script language="groovy">
                    return new DSResponse().setFailure("ERROR")
                </script>
            </operationBinding>
        </operationBindings>
    </DataSource>
    then open the upload sample:

    - select a file to upload (a file which you can modify easily)
    - click "Save" and get the upload error
    - modify the file
    - click save, again

    you'll see that the request fails, and you can't do nothing (until the timeout expires).

    In real use cases this happens when a user upload an excel/csv file, gets an error because the excel format is wrong, and so he opens the file, modifies and saves it.

    It would be nice that the framework could detect the problem, so we may at least warn the user.


    #2
    Hi, a couple of clarifications here:

    1. is this browser-specific (you mention Chrome)

    2. are you saying that the submitted file is stale?
    2.a. if so, is the user actually re-selecting the file via the upload control, or just modifying the file on disk?

    3. you mention a timeout - so does the second request just hang?

    4. do you see the second request hit the server, or does it appear to never leave the browser?

    5. if it hits the server, is there some kind of error processing the request? If so, we need the logs

    6. is there a JS error, if so, can you provide the stack trace?


    Comment


      #3
      1. yes, it is Chrome specific, it's working with FF for instance
      2. yes it's stale, ie after submitting a cvs file, I open, modify and save it
      2.a. our users aren't re-selecting the file, but in my tests doesn't seem to make a difference
      3. yes it hangs
      4. no, it doesn't hit the server
      5. -
      6. no, there isn't a js error, only a request with status failed in the Chrome network tab (net::ERR_UPLOAD_FILE_CHANGED)

      Comment


        #4
        Hi Claudio
        This is just a quick update to reassure you that we are reproducing this issue and have a developer investigating. We will follow up with more information soon

        Regards
        Isomorphic Software

        Comment


          #5
          We've now made a change to address this issue.
          At the browser level, Chrome now restricts access/upload to files that have been edited on the file system as a security measure - (see this "wontfix" bug report on chromium.org for more information: https://bugs.chromium.org/p/chromium...?id=1086707#c7)
          We've added some logic to detect the case where file access is denied by the browser on attempted upload. The system will now clear the FileItem / UploadItem's value, and prompt the user to re-select the file [or select a new file]. See the new property dynamicForm.fileAccessFailedWarning)

          This change will be present in nightly builds going forward (dated March 4 or above), in the 12.1, 13.0 and 13.1 branches

          Regards
          Isomorphic Software

          Comment


            #6
            SmartClient Version: v12.1p_2022-03-05/Enterprise Development Only (built 2022-03-05)

            Hello, I've just tested it in the showcase and the solution is neat and tidy. Could you please also put the fileAccessFailedWarning property in the i18n files?

            Thank you very much

            Comment


              #7
              We've added this attribute to the language-packs for tomorrow's builds - you can translate it at Weblate when you're ready.

              Comment

              Working...
              X