Trying to download a .docx
file received from the backend.
The object being received is shown below:
https://i.sstatic.net/nHKpn.png
Download attempt using the following code:
const blob = new Blob([fileSource.FileData], { type: fileSource.FileType });
FileSaver.saveAs(blob, (fileSource as FileAttachmentDetail).FileName);
The downloaded file seems to be corrupted. When attempting to open it, the error displayed is:
https://i.sstatic.net/JzXXD.png
After choosing an option (yes or no), the message remains the same:
https://i.sstatic.net/xKKB3.png
What could be causing this issue?