Header missing when uploading files
Hi,
I'm using the FileManager exactly like this https://blazor.syncfusion.com/documentation/file-manager/how-to/customize-http-handler but it looks like when I try to upload a file, the token is not in the headers even though the OnBeforeSend event is correctly triggered.
The token is here on the first request to get the files, but not on upload.
Regards,
Julien
Hi Julien,
Greetings from Syncfusion Support.
Based on the issue you reported, we prepared a sample using the File Manager component to replicate the behavior you mentioned. In this sample, we pass the authorization header for the upload operation and were able to successfully receive the header in the service.
We tested the sample using our latest Syncfusion version and the Edge browser. During testing, the authorization header was received correctly for the upload operation, and we did not encounter any issues while sending the headers. We have attached the tested sample for your reference. Kindly review it and ensure that the required configurations and changes are properly applied in your application to send the headers.
Additionally, we recently identified an internal issue related to passing headers to the service during the upload operation, and this has been resolved in our latest version. The fix is available starting from v31.2.15. If you are using a version earlier than this, we kindly request you to update to the latest version to access the fix. In our latest version, we did not observe any issues related to sending headers for the upload operation.
For your convenience, we have also shared our documentation on upgrading to the latest version.
Release history of Blazor components - Syncfusion
Code Snippet:
|
<SfFileManager TValue="FileManagerDirectoryContent">
<FileManagerUploadSettings UploadMode="UploadMode.HttpClient"></FileManagerUploadSettings> <FileManagerEvents TValue="FileManagerDirectoryContent" OnSend="OnBeforeSend"></FileManagerEvents> </SfFileManager> public void OnBeforeSend(BeforeSendEventArgs args) {
args.HttpClientInstance.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Authorization", "User1"); }
Provider[Filemanagercontroller.cs]
public IActionResult Upload(string path, long size, IList<IFormFile> uploadFiles, string action) { var header = HttpContext.Request.Headers["Authorization"]; } |
If you are still facing the issue after upgrading to the latest version, please share the following details, which will help us investigate further:
- Your File Manager component configuration
- The type of provider used (Syncfusion provider or custom provider)
- If Syncfusion provider, please share the provider’s name
- The environment in which the application is tested
- Try reproducing the issue using the attached sample
- If possible, share a minimum issue‑reproducible sample
We look forward to your response and will be happy to assist you further.
Regards,
Praveen Sellappan
Attachment: filesample_e0932cb5.zip
I'm on 33.1.45 so it's not about the package version.
I've figured out that it fails when there is an async call inside the OnBeforeSend method.
Here is how I need to set up the header :
args.HttpClientInstance.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", await _localStorage.GetItemAsync<string>("authToken")); |
Again, this works when the FileManager gets the files, but not on uploads.
Regards,
Julien
Hi Julien,
Based on the information provided, we have validated and classified the reported scenarios as a bug on our end. The fix for this issue will be included in the upcoming weekly release scheduled for May 5,2026. You can track the status of the fix at the following link:
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.
Regards,
Praveen
Hi Julien,
We regret to inform you that we were unable to include the fix for the reported issue in the weekly patch release as previously communicated.
However, we are pleased to inform you that the fix has been planned for inclusion in our upcoming weekly patch release, scheduled for May 19, 2026.
Thank you for your patience and understanding.
Regards,
Praveen Sellappan
Hi Julien,
Thanks for your patience.
The issue “Authorization Header Not Received During Upload Operation in Blazor FileManager Component” has been resolved in this release. To access this fix, we suggest you update the package to the latest version (33.2.8). We have also included the sample in the main version for your reference.
Root cause: Windows Authentication automatically adds an authorization token, but an extra header was also being added, causing upload failures. Skipping the header fixed that issue but also prevented user‑provided tokens from being sent, leading to upload failures in custom scenarios.
Sample: Attached as Zip.
Release Note: Essential Studio for Blazor Release Notes - v33.2.8
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Praveen Sellappan
Attachment: filesample_301adda2.zip
Hi,
Looks like this bug is still there in v33.2.12.
I can't set the Bearer in the async OnBeforeSend methods.
Regards,
Julien
Attachment: FileManagerSample_9aaa9e2d.zip
Hi,
On the version v34.1.31if the token contains a dot (e.g. "
eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIyIiw
") then the header is totally removed.
Regards,
Julien
Hi Julien,
- 9 Replies
- 2 Participants
- Marked answer
-
JB Julien Barach
- Apr 10, 2026 12:42 PM UTC
- Jul 27, 2026 02:56 PM UTC