Adding a bearer token in the CurrentRequest doesn't work on FileSelected event

Hi,

Some times ago it was recommended to use the FileSelected event to add headers to the CurrentRequest object.

Now it doesn't work anymore.


I know that I can use the BeforeUpload event instead but I wonder if there is a bug or regression on FileSelected.

My file uploaders stopped working and I don't know what SF version caused this regression and why.


Please provide some explanations about why it stopped working.


Regards,


6 Replies 1 reply marked as answer

UD UdhayaKumar Duraisamy Syncfusion Team February 11, 2025 05:31 PM UTC

We have confirmed that the issue "Adding a bearer token in the CurrentRequest doesn't work on the FileSelected event" is a bug on our end. A fix for this issue is scheduled to be included in our patch release by the end of February 2025.


You can now track the status of the feedback through the below link,

Adding a bearer token in the CurrentRequest doesn't work on FileSelected event in Blazor | Feedback Portal


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”




MI Mike-E February 23, 2025 03:05 PM UTC

Oh wow I am glad this is here.  In my case sometimes it works, but other times it does not.  I have to drop back into 27.x and upload the file to "fix" it.



YV Yaswin Vikhaash Rajaretenam Syncfusion Team February 25, 2025 12:03 PM UTC

Hi Mike-E & Julien Barach,


Query: Adding a bearer token in the CurrentRequest doesn't work on the FileSelected event


Feedback: Adding a bearer token in the CurrentRequest doesn't work on FileSelected event in Blazor | Feedback Portal


We have included the fix for the issue "Adding a bearer token in the CurrentRequest doesn't work on the FileSelected event" with our package version 28.2.6. So, can you please upgrade your package to the latest to resolve the issue from your end?


Release notes: https://blazor.syncfusion.com/documentation/release-notes/28.2.6?type=all#uploader


Root cause:

We have removed the highlight selection when keyboard action is made such as keydown and Enter by using the removeFillSelection method . But when is selection is made via mouse , the respective method is not invoked and results in the reported issue .


Regards

Yaswin Vikhaash


Marked as answer

MI Mike-E March 8, 2025 11:31 AM UTC

Hi Yaswin, thank you for your efforts.  I can confirm the bearer token gets sent now, thank you!


However, it appears CustomFormData is no longer sent on requests.  Can you please confirm?  I can get  CustomFormData when there are chunks of data, but when there is 1 full file, the values are not sent to the server.



MI Mike-E March 8, 2025 11:39 AM UTC

Nevermind!  I had some environmental configurations that was causing my issue.  This apparently was changed in a previous version and BeforeUpload is now used:

https://www.syncfusion.com/forums/183386/customformdata-doesnt-seem-to-work-in-onuploadstart


All is working now.  Thank you again for your efforts and great support. 👍



SS Shereen Shajahan Syncfusion Team March 11, 2025 04:33 AM UTC

Hi Mike-E,

Thank you for the update. Please get back to us for assistance in the future.

Regards,

Shereen


Loader.
Up arrow icon