@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.Inputs
<h4> Upload custom header </h4>
<EjsUploader>
<UploaderEvents FileSelected="OnFileSelect"></UploaderEvents>
<UploaderAsyncSettingsSaveUrl ="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.CurrentRequest = new List<object> { new { custom - header = "Syncfusion" } };
}
} |
@using Syncfusion.Blazor.Inputs
<SfUploader ID="UploadFiles">
<UploaderEvents FileSelected="onFileSelect"></UploaderEvents>
<UploaderAsyncSettings SaveUrl="api/SampleData/Save">
</UploaderAsyncSettings>
</SfUploader>
@code {
private void onFileSelect(SelectedEventArgs args)
{
args.CustomFormData = new List<object> { new { Name = "Syncfusion" } };
}
} |
@code {
public class Custom
{
public string Header { get; set; } = "header";
}
public Custom custom = new Custom();
private void onFileSelect(SelectedEventArgs args)
{
var headername = custom.Header;
args.CurrentRequest = new List<object> { new object[] { headername, "Syncfusion" } };
}
} |
Awesome, I've spend ages looking at this and this worked perfectly!
Hi Scott A Shaw,
We are delighted to hear that your needs have been fulfilled. We look forward to serving you in the future.
Regards,
Yohapuja S