RadzenUpload component custom parameter problem

Hello.

I experience problem with upload component. I tried to follow the online demo.

I need to send DB connection string thru the upload's HttpPost method.

Well, adding custom parameter to the URL of upload parameter partially works, but it always cuts the "\" characters from the string.

Here is my RadzenUploadCode:

                    <RadzenUpload Url=@($"upload/single/{uploadParams}") @ref ="upload" Complete="@OnComplete" Error="@OnError" Style="margin-bottom:20px;"
                    Accept=".csv, .dat" ChooseText="Vyberte soubor">

And here is the controller part:

        [HttpPost("upload/single/{uploadParams}")]
        public IActionResult Single(IFormFile file, string uploadParams)
        {

The string before it is send looks like this:

Data Source=NTCSQL403\\I01;Initial Catalog=Components;User ID=DT_;Password=***;Integrated Security=false;TrustServerCertificate=true;MultipleActiveResultSets=true

And in the controller:

Data Source=NTCSQL403I01;Initial Catalog=Components;User ID=DT_;Password=***;Integrated Security=false;TrustServerCertificate=true;MultipleActiveResultSets=true

Please, can you help me?

Maybe you can convert your parameter to base64 string and later decode it.

1 Like

It worked. Thank you very much.

I used the base64 coding. On local(from Visual studio] it works well.

But when I publish the version to our development environment, I get this error message in the debug console:

Probably the custom parameter cannot go thru the POST message.

I’m afraid I don’t know what’s causing this null reference exception.