add blob type

This commit is contained in:
juliandescottes 2016-10-10 02:17:19 +02:00
parent 85336f9b9a
commit d947fe1c05
2 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@
var fileName = piskelName + '-' + timestamp + '.piskel';
try {
pskl.utils.FileUtils.downloadAsFile(new Blob([serialized]), fileName);
pskl.utils.FileUtils.downloadAsFile(new Blob([serialized], {type : 'application/piskel+json'}), fileName);
deferred.resolve();
} catch (e) {
deferred.reject(e.message);

View file

@ -8,9 +8,9 @@
ns.FileUtils = {
readFile : function (file, callback) {
var reader = new FileReader();
reader.onload = function (event) {
callback(event.target.result);
};
reader.addEventListener('loadend', function() {
callback(reader.result);
});
reader.readAsDataURL(file);
},