I have a form action post inside an html that I call the following appscript function, to upload a file to google drive
function doPost(e) {
var data = Utilities.base64Decode(e.parameters.data);
var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
var folder = DriveApp.getFolderById("-----"); //Get folder of destiny for file (final user need access before execution)
var newFile = folder.createFile(blob); //Create new file (property of final user)
return?!!!?!?!?!!?!?!?! //HERE IS MY PROBLEM
}
Is there any way that when I hit submit it doesn't take me to the google app script page indicating a code? I mean it stays inside my html without reloading the page
I attach my form just in case
<form action="https://script.google.com/macros/s/----------/exec" id="form" method="post">
<div id="data"></div>
<input name="file" id="uploadfile" type="file">
<input id="submit" type="submit">
</form>