Created
March 13, 2013 15:49
-
-
Save beshkenadze/5153435 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bookBlob = new Blob([blob], { | |
type: "application/zip" | |
}); | |
// blob contains the zip file as a Blob object | |
var fileReader = new FileReader(); | |
fileReader.onload = function (evt) { | |
// Read out file contents as a Data URL | |
var result = evt.target.result; | |
try { | |
localStorage.setItem("file", result); | |
} catch (e) { | |
console.log("Storage failed: " + e); | |
} | |
}; | |
// Load blob as Data URL | |
fileReader.readAsDataURL(bookBlob); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment