This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Possibility to save image on LM
#3
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

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 worksWink I will check. But I thinked that it would be much simpler,)
Reply


Messages In This Thread
RE: Possibility to save image on LM - by buuuudzik - 19.09.2017, 08:44

Forum Jump: