Earlier today I did a post regarding File Upload and being able to rename the incoming file.
I did find your example of Upload with a custom parameter.
The example showed the markup, but did not show what the Uploadcontroller looks like when you are passing a parameter.
I tried 2 different prototypes and both fail on execution.
// Single file upload
[HttpPost("upload/single")]
public async Task SingleAsync(IFormFile file)
{
// Single file upload
[HttpPost("upload/single")]
public async Task SingleAsync(IFormFile file,string NewFileName)
{
Can you provide an example of the UploadController for uploading a single file with a 'parameter' ?
I'm using the Radzen IDE (Blazor Server) and can't get the upload controller to accept a parameter .
Without the parameter it works, when I change the controller to accept a parameter the file is empty .
What should be put in the URL and ParameterName when the controller route is to "upload/single/{id}"
I misunderstood your question. Do you need to upload single file or multiple files with additional parameter? If using our sample upload controller you don't have to specify ParameterName since both single and multiple files upload roots will use the default names - file and files.
Uploading a file the parameters in the controller has the value 0 . My value is not passed to the controller.
Also when you have defined an alternative text to "ChooseText" the designer does not adapts to this and displays the text "Choose" on the upload button.
File is uploaded but the parameter is not .. somehow this does not work for me?