add blob type
This commit is contained in:
parent
85336f9b9a
commit
d947fe1c05
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue