Skip to content

Instantly share code, notes, and snippets.

@beshkenadze
Created March 13, 2013 15:49
Show Gist options
  • Save beshkenadze/5153435 to your computer and use it in GitHub Desktop.
Save beshkenadze/5153435 to your computer and use it in GitHub Desktop.
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