RadzenUpload doesn't fire controller

Hi,
after migrating my project to net.8 server, RadzenUpload does not invoke the controller and returns an empty error.
All other components work properly.
What am I doing wrong?
the component

<RadzenUpload Icon="upload" Complete=@(args => OnComplete(args, eTipoDocumento.RefertoDb)) Error="UploadError" Accept=".db" class="w-100"
                Url="upload/single" ChooseText="" Progress=@(args => OnProgress(args, "Solo files con estensione .db"))>
    <RadzenUploadHeader Name="Authorization" Value="@($"Bearer {eAut.Token}")" />
</RadzenUpload>

And controller

using Ergo.Fipav.Sol.ViewModels;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Ergo.Fipav.Sol.Controllers
{
    [DisableRequestSizeLimit]
    public partial class UploadController : ControllerBase
    {
        IComitatoViewModel _comuneViewModel;
        public UploadController(IComitatoViewModel comune)
        {
            _comuneViewModel = comune;
        }

        [HttpPost("upload/single")]
        public async Task<IActionResult> single(IFormFile file)
        {
            try
            {
                string jwtToken = Request.Headers["Authorization"].ToString().Replace("Bearer ", "");
                _comuneViewModel.SetAuthorization(jwtToken);

                await _comuneViewModel.AzzeraMessaggi();
                if (file.Length > 3000000) // 3MB
                {
                    throw new Exception("Dimensione file eccessiva, deve essere minore di 2 MBytes");
                }
                return Ok();
            }
            catch (Exception ex)
            {
                return BadRequest(ex.Message);
            }
        }
    }
}

Thanks

Check what request is made using your browser developer tools network inspector.

Thanks for the prompt response, here's the request

<input id="EPLVgU1RSE" type="file" accept=".db" onchange="Radzen.uploadInputChange(event, 'upload/single', true, false, true, '')" tabindex="-1" onkeydown="event.stopPropagation()" _bl_c99ba81a-6422-4b59-996f-2922a0dc9ec3="">

This is the HTML element and looks correct.

Check the developer tools network tab and see what the response of the upload HTTP request is.

URL richiesta:
https://localhost:7297/upload/single
Request Method:
POST
Codice stato:
404 Not Found
Indirizzo remoto:
[::1]:7297
Criterio referrer:
strict-origin-when-cross-origin

In net 6 and net 7 everything worked fine

This means that your controller is not properly registered. I suggest troubleshooting that. RadzenUpload behaves correctly in this case.

1 Like

Thank you a lot, in Program.cs I had not mapped the controllers (in Net 7 it was not necessary)
So, for anyone who has the same problem as me

builder.Services.AddControllers();
var app = builder.Build();
   ...
app.MapControllers();
app.Run();

Problem solved