I am trying to download the data from an API, which is sending the data content-type as application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, the file gets corrupted not able to open…if I change the name to csv of same file then I can see the binary data…
When I hit the request from postman and save the response…the file gets open without any issue…
Hi there!!! Sorry you’re facing this issue.
When you can you share a screenshot of what your download function call looks like for application/vnd.openxmlformats-officedocument.spreadsheetml.sheet file type?
Hello @Jonathan0 and welcome to our community! What is your Appsmith version? Could you please send some screenshots of your implementation and the error you are getting?
And in appsmith I just want to be able to download it. I tried copying an example code in the dcoumentation. I can see the body data from the request seems also odd.
It downloads the file fine but when I try to open it in excel it’s corrupt. It works fine with postman and trying with the swagger so it’s not the API.
I logged the GetXSLX.data.length and it’s always a bit smaller that the request response body and Content-Length.
As the original poster commented, my files are also always a bit smaller than with postman. It seems it’s truncating a bit of the data between the request response body and the data variable.
I am now simply trying with:
download(GetXLSX.data, “TestFile.xlsx”);
Hi there!
We’re still working on a permanent fix for this issue.
Someone from the team will definitely reach out to you for further updates.
Thank you for your continuous support