From 491067b07060cec65813702e68c755a190842930 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Wed, 31 Jan 2018 14:17:21 +0100 Subject: [PATCH] use blob instead of file for iOS 9 --- src/interface/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interface/utils.js b/src/interface/utils.js index 094586a..f52acd6 100644 --- a/src/interface/utils.js +++ b/src/interface/utils.js @@ -188,16 +188,16 @@ export async function slice(target, name, mesh, settings, updateProgress) { switch (target) { case 'DOWNLOAD': { - const blob = new File([gcode], `${name}.gcode`, { type: 'text/plain' }); - fileSaver.saveAs(blob); + const file = new Blob([gcode], { type: 'text/plain' }); + fileSaver.saveAs(file, `${name}.gcode`); break; } case 'WIFI': { if (settings.printer === 'doodle3d_printer') { const body = new FormData(); - const file = new File([gcode], 'doodle.gcode', { type: 'plain/text' }); - body.append('file', file); + const file = new Blob([gcode], { type: 'plain/text' }); + body.append('file', file, 'doodle.gcode'); // because fetch has no way of retrieving progress we fake progress let loaded = 0;