function uploadFiles(){const htmlDlg = HtmlService.createHtmlOutputFromFile('Index').setWidth(350).setHeight(425);SpreadsheetApp.getUi().showModelessDialog(htmlDlg, 'Email Attachments');}function serverFunc(formObject){const blob = formObject.myFile;const file = DriveApp.createFile(blob);return 'File uploaded successfully: ' + file.getName();}
<!DOCTYPE html><html><head><base target="_top"></head><body><form id="myForm" onsubmit="submitFunc(this)"><div class="form-group"><label for="myFile">Upload File</label><input name="myFile" class="myFile" type="file" id="myFile" /></div><br><button type="submit">Submit</button></form><br><div id="output"></div></body><script>function submitFunc(formObject){google.script.run.withSuccessHandler(onSuccess).serverFunc(formObject)}function onSuccess() {var Output = 'Input Succesfully Translated';alert(Output)google.script.host.close()}</script></html>
This email is confidential and is intended for the above-named recipient(s) only. If you are not the intended recipient, please delete this email from your system. Any unauthorized use or disclosure of this email is prohibited.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/23dce389-fc86-4237-893f-72681b863128n%40googlegroups.com.