This is a migrated thread and some comments may be shown as answers.

Save handler called multiple times for group of files?

1 Answer 71 Views
Upload
This is a migrated thread and some comments may be shown as answers.
BitShift
Top achievements
Rank 1
Veteran
BitShift asked on 20 Oct 2020, 09:16 PM

Im trying to allow multiple files to be uploaded, but instead of getting all the files sent into the handler, its one at a time, at least with Chrome.

What can I check?

My save api handler has a signature like this

[HttpPost]
public async Task<IActionResult> Save(IEnumerable<IFormFile> files, string SelFileType)

If I have 3 files selected for example, that method gets called 3 times each with a seperate file, instead of 1 with a collection of IFormFile objects

The upload control

<TelerikUpload SaveUrl="@SaveUrl" Multiple="true"                               
               OnUpload="@OnUploadHandler"  OnSelect="@OnFileSelectHandler" OnError="@OnFileErrorHandler" OnSuccess="@OnSuccessHandler"/>

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 21 Oct 2020, 09:36 AM

Hi,

The Save handler is called once for each file and that's expected. I have clarified this in the documentation for you (commit link).

 

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Upload
Asked by
BitShift
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Share this question
or