Reputation: 1181
I am trying to get excel files fetched by my web app to open the downloaded excel file automatically in the excel app installed on the users machine.
i know you're supposed to use urls like so: ms-excel:ofe|u|https://my-location/my-file.xlsx
but our excel files are locked down and require authentication to access making the normal use case for office uri schemes unavailable.
we are currently already downloading the file as a blob, creating an <a>
and setting the url/download/fileName appropriately in order to download the file, it just doesnt open automatically. I am wondering if there is a way to replace https://my-location/my-file.xlsx with the exact same url we are already setting in our to download the file from a blob? all attempts to do so have failed even though it seemingly should work?
For example we use window.URL.createObjectURL(myBlob)
and that creates something like: blob:http://localhost:4200/61880b0c-0c8e-491a-b347-b007660ae265
if i paste that exact url into a chrome tab it downloads the file successfully. however if i then add ms-excel:ofe|u|
in front of it i get an error when it tries to open that in excel. ive even tried to convert the blob to base64 and use that in place of the blob url but that seems to work even less. it opens the excel app but then does nothing (not even give me an error message).
so is there a way to use a blob with the excel uri scheme to auto-open it once the webapp retrieves it?
We would like to avoid having to go the presigned url route just to get this small feature working
Upvotes: 1
Views: 175