We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Uploader. Selecting multiple files consecutively only uploads last file dropped or selected.

When selecting multiple files consecutively with the uploader control, each placed on the control individually, the files are shown in the box but only the last file dropped is uploaded to the server.

I am uploading the files as part of the form post back.

    @Html.EJS().Uploader("UploadFiles").Multiple(true).AutoUpload(false).Selected("onSelect").Render()

Script:
 function onSelect(e) {
            this.element.files = e.event.dataTransfer.files;
        }

9 Replies

BC Berly Christopher Syncfusion Team September 2, 2019 12:37 PM UTC

Hi John, 
 
  
Greetings from Syncfusion support. 
 
  
We can get the file name in the Synchronous upload (Inside the form) while choosing multiple files at the same time only. We can get the last selected file if we select multiple files one by one. This issue is known issue in the HTML 5 File Upload component.  
   
So, we are currently implementing the below mentioned feature in the Uploader component. Once it will be implemented the reported issue will be fixed and this support will be available in the Volume 3 release expected in the month of October 2019. You can track the status of this feature from the below feedback link.   
 
  
Regards,  
Berly B.C 



JJ Juan Jiminez November 27, 2020 10:09 PM UTC

Hi SF,

Sorry for stepping in this one but it has been a year since the fix request was created and I'm experiencing this issue with the latest release.

Any updates on when this will be fixed or is this discarded by now?

The issue is selecting the files one by one on syncronous upload as opposed to selected all at the same time. When you browse each file separately, only the last file is posted.

Thanks in advance.


PO Prince Oliver Syncfusion Team November 30, 2020 05:27 PM UTC

Hi John, 

Thank you for you update. 

This feature is available since the version v17.3.26. Kindly refer to the following release notes section:  

We suspect that you might have used the HttpPostedFileBase to get the files in the form post instead of using IList<HttpPostedFileBase> in your end.  

        [HttpPost] 
        public ActionResult Index(IList<HttpPostedFileBase> UploadFiles
       

            return View(); 
       
  

Kindly check the above suggestion and get back to us, if you still face any issue. 

Regards, 
Prince 



JJ Juan Jiminez December 1, 2020 03:10 PM UTC

Hi Prince,

Thanks fo the follow up, the issue is still present if you use the image preview feature, I've created a new ticket for this other issue https://www.syncfusion.com/forums/160218/uploader-selecting-multiple-files-consecutively-only-uploads-last-file-when-using-preview


SN Sevvandhi Nagulan Syncfusion Team December 2, 2020 01:11 PM UTC

Hi Juan, 


Thanks for the update. Please let us know if you need further assistance. 


Regards, 
Sevvandhi N 



CB Cedric Baynard April 6, 2021 04:30 PM UTC

Can you provide and example of how to use the clearAll() method to resolve this issue?


JC Joseph Christ Nithin Issack Syncfusion Team April 7, 2021 01:28 PM UTC

   Hello Cedric, 

     Greetings from Syncfusion support, 

     We have checked your query, It would be helpful if you mention the issue you are facing in detail so that we would be able to provide the sample more precisely. 

Regards, 
Joseph Christ Nithin I. 



CB Cedric Baynard April 9, 2021 01:29 AM UTC

Thank you for your reply.   We are having the issue where only the last file is returned when selecting multiple files with the ejs-loader control. This thread referenced a fix by Syncfusion that talked about performing a "Clear All" instead of a remove?   I was seeking clarification on what if any resolution for this problem of passing only the last file back.   Is there any way of preventing the ejs-control browse button from being clicked more than once?   I know that your control captures multiple "files" from browse on the inital form instance and works properly in sending all files when you only browse 1x to select the files.



JC Joseph Christ Nithin Issack Syncfusion Team April 13, 2021 03:57 AM UTC

Hello Cedric, 
   
   Thanks for the update. We have checked your query.  

Query 1: I was seeking clarification on what if any resolution for this problem of passing only the last file back. Is there any way of preventing the ejs-control browse button from being clicked more than once? 

To prevent the browse button being clicked more than once, the browse button can be disabled by setting the ‘disable’ property of the ‘browseButton’ true on the ‘onSelect’ event. 


<div style="margin-top:20px;margin-left:20px;"> 
 
    @Html.EJS().Uploader("UploadFiles").DropArea(".control-fluid").Multiple(false).AutoUpload(false).Selected("onSelect").Clearing("onClearing").Removing("onRemoving").Render() 
</div> 
 
<script> 
    function onSelect(args) { 
        disableBrowse(args); 
    } 
 
    function onClearing(args) { 
        disableBrowse(args); 
    } 
 
    function onRemoving(args) { 
        disableBrowse(args); 
    } 
 
    function disableBrowse(args) { 
        var uploadObj = document.getElementById("UploadFiles").ej2_instances[0]; 
        var filesData = uploadObj.getFilesData(); 
        var allFiles = filesData.concat(args.filesData); 
        var browseButton = uploadObj.browseButton; 
        browseButton.disabled = allFiles.length == 1 ? true : false; 
    }  
</script> 




Query 2: I know that your control captures multiple "files" from browse on the inital form instance and works properly in sending all files when you only browse 1x to select the files. 

It is possible to prevent the uploader from uploading more than one file by setting the ‘Multiple’ property as false.  



Please find the attached sample and revert for more queries. 


Regards, 
Joseph Christ Nithin I 


Loader.
Live Chat Icon For mobile
Up arrow icon