2

I am facing issues in using the msSaveBlob and msSaveOrOpenBlob methods on IE 10. These methods seem to be working on IE 11 and IE 10 version 10.0.9200.17183 but the API fails on IE 10 version 10.0.9200.16844.

I am trying the Example 1 code on this site http://msdn.microsoft.com/en-us/library/ie/hh779016%28v=vs.85%29.aspx#blobbuilder

<!DOCTYPE html>
<html>

<head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>Example 1</title>
</head>

<body>
<h1>Example 1</h1>
<script>
var blobObject = new Blob(["I scream. You scream. We all scream for ice cream."]); 

window.navigator.msSaveBlob(blobObject, 'msSaveBlob_testFile.txt'); // The user only has the option of clicking the Save button.
alert('File save request made using msSaveBlob() - note the single "Save" button below.');

var fileData = ["Before you insult a person, walk a mile in their shoes. That way, when you insult them, you'll be a mile away - and have their shoes."];
blobObject = new Blob(fileData);
window.navigator.msSaveOrOpenBlob(blobObject, 'msSaveBlobOrOpenBlob_testFile.txt'); // Now the user will have the option of clicking the Save button and the Open button.
alert('File save request made using msSaveOrOpenBlob() - note the two "Open" and "Save" buttons below.');
</script>
</body>

</html>

Below is a screenshot of behavior on the two versions of IE 10 Screenshot of behavior on the two versions of IE 10

Is there an alternate method to export blob on the version of IE 10 where the methods are failing?

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
Sarvesh
  • 637
  • 9
  • 17
  • It *fails* how exactly? Are you getting any errors in the console? – Sampson Jan 11 '15 at 05:11
  • There are no errors in the console. It shows a file being downloaded with the title as a GUID instead of the title that i provide. Also when i choose to save i get a message saying save failed. – Sarvesh Jan 11 '15 at 05:30
  • Screenshot Showing behavior on both browsers https://www.dropbox.com/s/zb96r6u7w4y6phb/IE10%20Blob.png?dl=0 – Sarvesh Jan 11 '15 at 05:42
  • Please share the code that performs the download as well. – Sampson Jan 11 '15 at 05:43
  • Its the first example on this page http://msdn.microsoft.com/en-us/library/ie/hh779016%28v=vs.85%29.aspx#blobbuilder – Sarvesh Jan 11 '15 at 06:08
  • Please share your implementation, from your own code. Just so no assumptions are made regarding your question. – Sampson Jan 11 '15 at 06:42
  • I have edited the post to include the code. I am not doing anything extra. Same code from the msdn page. – Sarvesh Jan 11 '15 at 12:11
  • @Sarvesh: did you get any solution for the problem. I am facing the same problem. – Abdur Rahman Mar 06 '16 at 10:19
  • @AbdurRahman Sorry we gave up on trying to support this for that particular version of IE – Sarvesh Mar 07 '16 at 15:07

1 Answers1

1

Blob is only supported on IE10 Platform Preview 4 and above:

Platform Preview 4 adds support for BlobBuilder, a way for developers to create new files. IE10 also has two new methods that allow the user to save blobs to their computer, enabling great end-to-end experiences when working with client-resident data.

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265