问题
I have used msSaveBlob() command to download a CSV file. I am facing an issue although navigate.msSaveBlob() is returning true, and there are no errors on console. I am being prompted that
File Couldn't be downloaded. Retry or Cancel.
I am working on IE11, and OS is Windows Server 2012 R2. I also tried updating IE, but it is still not working.
I also tried the samples from MSDN, but facing the same issue. Kindly suggest me how to resolve this issue.
Code Snippet:
var blob = new Blob(["Sample String\r\n,For Checking, msSaveBlob"],{
type:'text/csv;charset=utf-8;'
});
if(navigator.msSaveBlob){
navigator.msSaveBlob(blob,"sample.csv");
}
回答1:
I have exactly the same issue and we found this.
Basically is a problem with user permissions to the temp folder on the IE. Because in some computers happen and others don't. So, I changed the folder on "Internet options" > General > settings > temporary internet files > move folder, and here I've chosen a folder with all the permissions active.
来源:https://stackoverflow.com/questions/35194359/navigator-mssaveblob-function-is-not-working-in-ie11