Excel File Downloaded From Blob Opens in Protected View

Viewed 371

I am trying to download an Excel file from my client using the file-saver JS library.

Currently, we hit an endpoint on the server to download the file. When it returns successfully, we use middle-ware to get the blob from the payload and then download it using FileSaver.saveAs(blob, fileName).

Previously, we used an iFrame to accomplish this.

Using the file-saver library, the source URL is blob:https://localhost:8080/...

Previously, there was no blob: text at the beginning of the URL, and it seems this text is causing the excel file to open in "Protected View".

We have the url "https://localhost:8080/*" in the list of Excel's trusted sources, and opening the file works fine using an iFrame.

Is there any way to remove the blob: prefix or make this download open regularly?

1 Answers

Its because of your local settings. You can follow this.

  1. Open Excel file.
  2. File--> Option --> Trust Center--> Trust center settings.
  3. Trust locations--> Add "Download" folder path as trusted.

Any file open from this location is trusted by Excel hence "Enable Edit" option will not be shown. All formulas pre-applied.

enter image description here

Related