use blob instead of file so it can be used on ios9

This commit is contained in:
casperlamboo 2018-01-31 13:32:16 +01:00
parent dd007b8bbf
commit 4cea3b3086

View File

@ -231,14 +231,14 @@ export async function slice(target, name, mesh, settings, updateProgress) {
body.append(key, fields[key]);
}
const file = new File([`;${JSON.stringify({
const file = new Blob([`;${JSON.stringify({
...settings,
name: `${name}.gcode`,
printer: { type: settings.printers, title: printerSettings[settings.printer].title },
material: { type: settings.material, title: materialSettings[settings.material].title },
quality: { type: settings.quality, title: qualitySettings[settings.quality].title }
}).trim()}\n${gcode}`], 'doodle.gcode');
body.append('file', file);
}).trim()}\n${gcode}`]);
body.append('file', file, 'doodle.gcode');
await fetchProgress(url, { method: 'POST', body }, progress => {
updateProgress({