Razor component in ASP.net Core 6.0 project

I'm trying to use Radzen Upload in a razor component that is used in a razor page.
I get some trouble to trigger the UploadController.
In fact, when i select a file, the radzen upload state thait is completed, but never trigger the Single method of the Upload Controller.
I tried to understand what happened, but i don't find a solution.
I think that the use of a razor component in a Razorpage may be the trouble, but i'm not sure.
Have you already met the problem ?

Hi @Pascal_Felix,

Could you tell us what you mean by a Razor page? Is it a Blazor .razor file or Razor .cshtml file? Also you can check if a HTTP request to the upload action is ever made (you can do so from the Network tab in your browser's developer tools).

Hi @korchev,
It's a .cshtml file where i put a personal razor component.
Here is the call :

In this razor component, i have a Radzen Grid that works perfectly well and i tried to put a Radzen Upload to upload a file but as i sais i can reach the Upload controller.
There is no error and in the Network tab nothing appears.
If you wnat i can send you a sample.

Hi @Pascal_Felix,

Check to see if there are any JS errors. The upload happens through a JavaScript call. You can even put a breakpoint in that method to see if it gets executed.

Hi @korchev,
I have understand what happened.
In my application, i have an Session Custom Middleware take control if we have a running session.
When we try to reach the controller session, this middleware detect there is no session for the controller and try to back to the login page.
That is weird it's that the login page is not shown and i dont know why.

It's for that reason that i think that whe don't reach the controller. But, when i saw in the network tab of Firefox, i saw the call to 'Single' method, so the call on login page.
Thanks for your help.

You don't see the login page as the upload performs XMLHTTP requests and those do not redirect (they won't load a different page). Probably you can exclude just that controller from the session middleware.

Yes, that what i did and now i can reach the Single method.
Last question, is it possible to modify this 'Single' method to pass it an addtionnal parameter ( the directory path where i want to paste the file) ?

Sure you can. Check our UploadController from the demo page: radzen-blazor/UploadController.cs at master · radzenhq/radzen-blazor · GitHub

For single file uploads something like this will work:

        public IActionResult Post(IFormFile[] files, int id)
                // Put your code here
                return StatusCode(200);
            catch (Exception ex)
                return StatusCode(500, ex.Message);

And here is how to pass the parameter:

<RadzenUpload Url=@($"upload/{customParameter}") />

Be careful with files paths though. The router can interpret them as part of the URL. If this happens you can use a query string parameter.

And can i change the type of id parameter into string ?

Yes. Our example uses int - you can use a string.

Yes, it's working, but my IFormFile[] files doesn't have files.
I missed something...

Everything is ok, now.
Thanks for your help.