Hey there.
We have used customDownload() function to send keycloak username and token to download api in file manager. The file name and extension of the file are not same as that of the original file after downloading it in file manager. Please find the attached code of both frontend and backend.
Hi Jyoti,
From the shared details, we understand that you are facing issues with the downloaded file format in the React FileManager component while using a custom download operation. We have prepared a simple sample of the React FileManager component with the Amazon S3 file service provider to implement a custom download operation, and the sample works fine with the downloaded file.
We would like to let you know that the reported issue occurs only when we miss content-disposition code details on the controller side. To overcome the issue, we suggest you include the below code changes in your controller Download method. Also, from the shared screenshot details, we suspect that you are using a custom service provider on your side.
We suspect that the issue occurs due to controller-level customization made from your side. We have attached the React local sample and the Amazon S3 file service provider for your reference. Refer to the below code snippet.
|
[FileManagerController.cs]
[Route("Download")] public IActionResult Download(string downloadInput) { var headerValue = Request.Headers["Custom-Header"].ToString(); Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition"); FileManagerDirectoryContent args = JsonConvert.DeserializeObject<FileManagerDirectoryContent>(downloadInput); return operation.Download(args.Path, args.Names, args.Data); }
|
Sample: https://stackblitz.com/edit/react-vuwczm?file=index.js
Service provider: https://www.syncfusion.com/downloads/support/directtrac/general/ze/amazon-s3-aspcore-file-provider-883348794.zip
Please check the attached sample and confirm whether the issue is resolved. If the issue still persists from your side, share the service provider details from your side. It will help us to provide a prompt solution.
Regards,
Sivakumar S
Thanks for your help. But your solution of controller side was in dot net and we are working in java. So can you please provide us a solution of controller side in java. Here is the code attached of controller side in java.
Hi Jyoti,
Thanks for the shared details.
Thanks for the shared details. As per the shared details, we understand that you are facing issues with the downloaded file format in the React FileManager component while using a custom download operation with a Java provider. We would like to let you know that in our syncfusion FileManager component, we have written service operations in C#. So, we are unable to replicate the reported issue from our side.
We have also attached the general blob related to the reported issue for your reference.
Please check the shared details and try it on your end. If the issue still persists, share with us your own customized Java service provider. It will help us to provide a prompt solution.
Regards,
Sivakumar S