URL.createObjectURL(blob) not creating proper URL in IE 11
IE does not create a url for these blob objects because of security reasons i think.So using var objectUrl = URL.createObjectURL(blob);will not give you the source url which you can use inside iframe or embed tag.
I faced the same issue and searched a lot about the fix.But could not get the answer.Instead i solved it as following.
you can use the following for IE
if (bowser.msie && window.navigator.msSaveOrOpenBlob) {
navigator.msSaveOrOpenBlob(file, fileName);
}else{
//do what you were doing for other than IE
}
the above IE code will prompt the user that whether he wants to save the file or directly open it.
User can click on button 'open' and then IE will show the PDF without downloading it in default reader.
Need to open blob/PDF in IE window
The reason why it works in Chrome and other normal browsers: they have pdf previewer installed inside of them.
The lease why it does not work in IE: since in architecture if IE there should be some PDF reading program installed on operating system; for instance, if you have Adobe Acrobat installed, you will open it without problems.
I can recommend you to use: pdf.js/.
Related Topics
Disable Form Auto Submit on Button Click
Open Links Made by Createobjecturl in Ie11
Electron Require() Is Not Defined
How to Disable HTML Button Using JavaScript
Good Tutorial For Using Html5 History API (Pushstate)
When Should I Use Inline Vs. External JavaScript
Open Url in Same Window and in Same Tab
How to Change CSS Property Using JavaScript
Refresh/Reload the Content in Div Using Jquery/Ajax
Browser/Html Force Download of Image from Src="Data:Image/Jpeg;Base64..."
Avoid Dropdown Menu Close on Click Inside
How to Read Text File in JavaScript
How to Make Ng-Bind-Html Compile Angularjs Code
Input Placeholders For Internet Explorer
Js Function Named 'Animate' Doesn't Work in Chrome, But Works in Ie