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

View File

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