ICEfaces
  1. ICEfaces
  2. ICE-10131

Showcase ace:fileEntry Cancel issue with multiple file uploads.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.0.BETA
    • Fix Version/s: 4.0
    • Component/s: ACE-Components, Sample Apps
    • Labels:
      None
    • Environment:
      Icefaces 4 trunk r41788. Tomcat 7, all browsers. Showcase ace:fileEntry demo.
    • Assignee Priority:
      P2
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      While verifying ICE-9898 the following issue was noticed:
      See attached screen shots FileEntry1.PNG and FileEntry2.png
      In FileEntry1.PNG there are 2 files to be uploaded. The second file fails because it is too large. The first file successfully uploads. When the messages are rendered, the successful uploaded file still shows that it can be cancelled, even though it has been uploaded.
      In FileEntry2.PNG, I cancelled the file that caused the warning message, but the successfully uploaded file still remains in the queue.

        Activity

        Hide
        Ken Fyten added a comment -

        Not sure if this is an easy fix or a conceptual issue with the way the multi-file upload is implemented.

        Show
        Ken Fyten added a comment - Not sure if this is an easy fix or a conceptual issue with the way the multi-file upload is implemented.
        Hide
        Arturo Zambrano added a comment -

        This use case wasn't contemplated when the component was initially developed. The logic in our server-side code is to clear ALL file selections only if ALL files were valid and successfully uploaded. I attempted to cover this use case in our code, but I encountered many obstacles that make it impossible to support this use case.

        First of all, the file entry component, in its multiple mode, adds one <input type="file"/> element for every time the user selects a file or files. Then, it populates a table element with the metadata of the selected file(s). This means that a single <input type="file"/> element can be used to upload multiple files if the user selected more than one file at the same time. So, for example, if a user selects two files at the same time, one small and the other too large, and the second file fails to upload for being too large, if we remove the <input type="file"/> element for the successfully uploaded file, we'd be also removing the large file from the upload list, not allowing the user to see what file specifically failed validation. To explain it more visually, when multiple files are selected at the same time, they all share the same 'Cancel' button in the table that lists them, so clicking that button will remove all those files from the list.

        Another obstacle is simply the fact that there's no way to identify which <input type="file" /> element corresponds to which file, when the response from the server comes back with the instruction to clear the file selection. There are just no parameters sent to map each individual <input type="file"/> element to each file; we simply let the browser take care of sending the multi-part request with only the basic necessary parameters/metadata to make the upload work. I tried adding a special function to remove a specific file, by identifying it by it's name, content type and size, which are the only things we know in the server from each uploaded file. While, it would be possible to remove individual files from the table, by comparing these values with the cells of each row, there's no way to use these data to remove the corresponding <input type="file"/> elements.

        One more obstacle is that even if the approach described in the previous paragraph worked to remove specific files, it wouldn't work for the cases when the uploaded files have the same name (but different path in the user's machine). For example, if the user is uploading log files that keep track of something in each folder, and these files have the same name and happen to be the same size, there would be some ambiguity about which file to remove.

        So, I'm closing this issue as won't fix.

        Show
        Arturo Zambrano added a comment - This use case wasn't contemplated when the component was initially developed. The logic in our server-side code is to clear ALL file selections only if ALL files were valid and successfully uploaded. I attempted to cover this use case in our code, but I encountered many obstacles that make it impossible to support this use case. First of all, the file entry component, in its multiple mode, adds one <input type="file"/> element for every time the user selects a file or files. Then, it populates a table element with the metadata of the selected file(s). This means that a single <input type="file"/> element can be used to upload multiple files if the user selected more than one file at the same time. So, for example, if a user selects two files at the same time, one small and the other too large, and the second file fails to upload for being too large, if we remove the <input type="file"/> element for the successfully uploaded file, we'd be also removing the large file from the upload list, not allowing the user to see what file specifically failed validation. To explain it more visually, when multiple files are selected at the same time, they all share the same 'Cancel' button in the table that lists them, so clicking that button will remove all those files from the list. Another obstacle is simply the fact that there's no way to identify which <input type="file" /> element corresponds to which file, when the response from the server comes back with the instruction to clear the file selection. There are just no parameters sent to map each individual <input type="file"/> element to each file; we simply let the browser take care of sending the multi-part request with only the basic necessary parameters/metadata to make the upload work. I tried adding a special function to remove a specific file, by identifying it by it's name, content type and size, which are the only things we know in the server from each uploaded file. While, it would be possible to remove individual files from the table, by comparing these values with the cells of each row, there's no way to use these data to remove the corresponding <input type="file"/> elements. One more obstacle is that even if the approach described in the previous paragraph worked to remove specific files, it wouldn't work for the cases when the uploaded files have the same name (but different path in the user's machine). For example, if the user is uploading log files that keep track of something in each folder, and these files have the same name and happen to be the same size, there would be some ambiguity about which file to remove. So, I'm closing this issue as won't fix.
        Hide
        Ken Fyten added a comment -

        We need to verify that when one or more files successfully uploads in this scenario where one or more other files fails, that the server-processing / listeners are all called as expected for the successful files.

        Also, this scenario and what to expect when it occurs needs to be documented on the fileEntry Wiki page.

        Show
        Ken Fyten added a comment - We need to verify that when one or more files successfully uploads in this scenario where one or more other files fails, that the server-processing / listeners are all called as expected for the successful files. Also, this scenario and what to expect when it occurs needs to be documented on the fileEntry Wiki page.
        Hide
        Arturo Zambrano added a comment -

        I verified what happens when some files fail validation and others not. What happens is what one would expect: the files that passed validation will be saved in the server, and the file entry listener will fire, and you'll be able to see what files were successfully uploaded and which weren't by examining the FileEntryResults.

        The wiki was updated with this information as well.

        Show
        Arturo Zambrano added a comment - I verified what happens when some files fail validation and others not. What happens is what one would expect: the files that passed validation will be saved in the server, and the file entry listener will fire, and you'll be able to see what files were successfully uploaded and which weren't by examining the FileEntryResults. The wiki was updated with this information as well.
        Hide
        Ken Fyten added a comment -

        Resolved as Won't Fix, documented the expected behaviour so it's clear what to expect.

        Show
        Ken Fyten added a comment - Resolved as Won't Fix, documented the expected behaviour so it's clear what to expect.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Liana Munroe
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: