nice to meet you.
An error occurs when trying to upload a gcode file using a Javascript client.
Anyone know how to make it work?
I'm trying with the code below but it doesn't work.
var element = document.createElement('input');
element.name = 'myFile';
element.type = 'file';
element.addEventListener('change', function(e){
var result = e.target.files[0];
var reader = new FileReader();
reader.readAsText(result);
reader.addEventListener('load', function(){
client.files.upload('local', reader.result, {filename: 'hogehoge.gcode'});
});
});
element.click();