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

No CustomFormData property on UploadingEventArgs

Hi

Want to send additional data with uploaded file.   
Documentation for UploadingEventArgs shows a property CustomFormData but when attempting to use gives error that UploadingEventArgs does not contain a definition for it.

John

1 Reply

GG Gopi Govindasamy Syncfusion Team August 26, 2019 09:17 AM UTC

Hi John,  

Greetings from Syncfusion support.  

We have provided support for “send additional data with upload files” and included in the below private NuGet package. The support will be include in our upcoming patch release which is scheduled on 28th August 2019. Until then, kindly use this below private NuGet for this support and utilize FileSelected event to send additional data (args.CustomFormData) as a key-value pair.  



Thanks for your patience and we will deliver the support to patch release as promised. 

Note: Clear NuGet cache and refer the local Nuget 

  1. Before install the NuGet, you must remove the bin and object folder in your application
  2. Tools -->options --> NuGet Package Manager --> General --> Clear All NuGet Caches
  3. Download the above NuGet packages
  4. Tools -->options --> NuGet Package Manager -->  Package Sources --> Click Add button --> browse the local package location --> click Update --> ok
  5. Right-click the project and select Manage NuGet Packages
  6. Select your private NuGet name and install the packages

Please find the sample and code snippet for your reference.  

@using Syncfusion.EJ2.Blazor 
@using Syncfusion.EJ2.Blazor.Inputs 
 
<h4>Upload Custom Header</h4> 
 
<EjsUploader> 
    <UploaderEvents FileSelected="OnFileSelect"></UploaderEvents> 
    <UploaderAsyncSettings SaveUrl="https://aspnetmvc.syncfusion.com/services/api/uploadbox/Save" 
                           RemoveUrl="https://aspnetmvc.syncfusion.com/services/api/uploadbox/Remove"></UploaderAsyncSettings> 
</EjsUploader> 
 
@code{ 
 
    public void OnFileSelect(SelectedEventArgs args) 
    { 
        args.CustomFormData = new List<object> { new { Name = "Syncfusion" } }; 
    } 
} 

Output:  
 
 


Regards, 
Gopi G. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon