前端操作 Apps Script 上傳檔案到 Google Drive 並取得連結﹍實作範例
Upload file to my google drive with Google Apps Script (NO FORM IN GOOGLE)
Create new project of Google Apps Script.
Sample script of Web Apps is a Google Apps Script. So please create a project of Google Apps Script.
If you want to directly create it, please access to https://script.new/. In this case, if you are not logged in Google, the log in screen is opened. So please log in to Google. By this, the script editor of Google Apps Script is opened.
Prepare script.
Please copy and paste the following script (Google Apps Script) to the script editor. This script is for the Web Apps.
Server side: Google Apps Script
Please set the folder ID that you want to put the file.
On the script editor, Open a dialog box by "Publish" -> "Deploy as web app".
Select "Me" for "Execute the app as:".
Select "Anyone, even anonymous" for "Who has access to the app:".
Click "Deploy" button as new "Project version".
Automatically open a dialog box of "Authorization required".
Click "OK".
Copy the URL of Web Apps. It's like https://script.google.com/macros/s/###/exec.
Sol: 開無痕式視窗,重新登入就可以開啟