Multiple Upload controls on same page - known issue?

Hi, if we have multiple upload controls in one component the file upload doesn't seem to work, is this a known issue?

3 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team August 27, 2020 03:46 PM UTC

Hi Alex,  

Greetings from Syncfusion support. 

We would like to inform you that, by using the ID attribute in the Uploader component, we can get the file on the server side. We can give any name to the component Id but you can get the file on the server side by using the same Id name. Kindly refer the below code. 
 
<SfUploader ID="UploadFiles1" AutoUpload="false"> 
    <UploaderAsyncSettings SaveUrl="api/SampleData/Save" RemoveUrl="api/SampleData/Remove"></UploaderAsyncSettings> 
</SfUploader> 
<SfUploader ID="UploadFiles2" AutoUpload="false"> 
    <UploaderAsyncSettings SaveUrl="api/SampleData/SaveBlog" RemoveUrl="api/SampleData/RemoveBlog"></UploaderAsyncSettings> 
</SfUploader> 

public async void Save(IList<IFormFile> UploadFiles1) { 
... 
} 
public async void SaveBlog(IList<IFormFile> UploadFiles2) { 
... 

Sample:  
 
Kindly check with the above sample meets your requirement. If not or if we misunderstood the query, please provide the below details. 

  1. Whether using the same handler for all uploader Components.
  2. Provide pictorial representation or video demonstration to replicate the issue.
  3. Try to replicate the issue in the provided sample.

The above requested details will help us to provide you the solution at earliest. 
 
Regards, 
Ponmani M


Marked as answer

TR Travis October 21, 2020 04:11 AM UTC

This deserves to go into the documentation.  Changing the ID in the HTML is expected as the ID attribute is often used in the DOM to find the object but changing the server side parameter name to match the ID was not obvious.
Happy I found this here though!


PM Ponmani Murugaiyan Syncfusion Team October 21, 2020 01:02 PM UTC

Hi Alex, 

Thanks for the update.  

The name attribute must match the name of a parameter in the POST method. For more information, refer the below link. The name attribute is automatically generated from the control’s ID property in Uploader component. 


We will include the above information in the online documentation and refresh soon in our end. 

Regards, 
Ponmani M 


Loader.
Up arrow icon