Denisa
February 8, 2024, 2:57pm
1
Hello,
I am using upload component for single and multiple file uploading.
When i upload single file, everything works fine.
But when i want to upload multiple files, the post is sended, but the IFormFile array (list, collection or whatever i tried) is empty
Am i doing something wrong?
Thanks!
Hello,
try to refer\work like the demo
Check the "Upload with additional parameter" example:
demo
This is the UploadController that the demo uses:
Source
Denisa
February 9, 2024, 6:57am
3
Sorry, I don`t see how additional parameters can help me with this issue.
Can you provide more information?
Thanks
mumfie
February 9, 2024, 7:49am
4
have you tried using an array instead?
Denisa
February 9, 2024, 8:16am
5
Yes, I have tried array, List and Collection, still does not work.
mumfie
February 9, 2024, 8:31am
7
verify the controller HttpPost directive and the parameters in the uploadcomponent url and controller method match.
Denisa
February 9, 2024, 8:58am
8
Url matchs, if not, the http will not be received by controller.
I have tried remove query part to send only IForm File, so my url looks:
Url="@($"http://localhost:5204/upload/multiple")"
But still, the IFormFile is empty.
I have tried select only one file, still empty. And When I select the same file with uploadcomponent with single, then the data is received correctly.
The name of the parameter is important. It should be files
for multiple files. Try with:
IList<IFormFile> files
instead of IList<IFormFile> file
. You can also specify a custom parameter name via the ParameterName property of RadzenUpload.
Denisa
February 9, 2024, 9:20am
10
It works!
Thank you very much.