Upload Component: Behavour change after version 4.28.4. Attached files now lost after StateHasChanged called. #1185

Closed
opened 2026-01-29 17:50:04 +00:00 by claunia · 2 comments
Owner

Originally created by @ryc76 on GitHub (Apr 9, 2024).

Describe the bug
When you bind the URL parameter to a variable you have to call StateHasChanged to get the Upload component to acknowledge the change.

Before version 4.28.5 this worked fine. Subsequent versions the list of files attached is lost.

To Reproduce
Bind URL to a parameter which is initially null.
Select a file to upload.
Force a change to the URL.
Run StateHasChanged
Action the upload.
The POST will action but there will be no files in the form.

Expected behavior
The file to be uploaded via the POST using the URL parameter now updated to a new value.

Originally created by @ryc76 on GitHub (Apr 9, 2024). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** When you bind the URL parameter to a variable you have to call StateHasChanged to get the Upload component to acknowledge the change. Before version 4.28.5 this worked fine. Subsequent versions the list of files attached is lost. **To Reproduce** Bind URL to a parameter which is initially null. Select a file to upload. Force a change to the URL. Run StateHasChanged Action the upload. The POST will action but there will be no files in the form. **Expected behavior** The file to be uploaded via the POST using the URL parameter now updated to a new value.
Author
Owner

@enchev commented on GitHub (Apr 9, 2024):

It was caused most probably by this change: 2077b0a35f
Not sure however if we can do anything to improve this.

@enchev commented on GitHub (Apr 9, 2024): It was caused most probably by this change: https://github.com/radzenhq/radzen-blazor/commit/2077b0a35f429e844dba554b81a46ab4ec665d76 Not sure however if we can do anything to improve this.
Author
Owner

@ryc76 commented on GitHub (Apr 15, 2024):

OK thanks for the response. I have updated my code to send a header using the RadzenUploadHeader component with the variable data as that gets updated without a need to force using StateHasChanged.

@ryc76 commented on GitHub (Apr 15, 2024): OK thanks for the response. I have updated my code to send a header using the RadzenUploadHeader component with the variable data as that gets updated without a need to force using StateHasChanged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1185