19.09.2017, 08:44
Thank you for reply Erwin, but I am thinking only about functionality like uploading images to Vis. graphics. I want develop app which uses images which must be imported by user. Via HTML + JS app must transfer file to .lp file which uses io.writefile() function.
I found something like this on stackoverflow:
HTML
JS:
But of course instead upload.php I must use upload.lp and maybe it would works I will check. But I thinked that it would be much simpler,)
I found something like this on stackoverflow:
HTML
Code:
<input type="file" id="filechooser">
JS:
Code:
function uploadFile() {
var blobFile = $('#filechooser').files[0];
var formData = new FormData();
formData.append("fileToUpload", blobFile);
$.ajax({
url: "upload.php",
type: "POST",
data: formData,
processData: false,
contentType: false,
success: function(response) {
// .. do something
},
error: function(jqXHR, textStatus, errorMessage) {
console.log(errorMessage); // Optional
}
});
}
But of course instead upload.php I must use upload.lp and maybe it would works I will check. But I thinked that it would be much simpler,)