Copy and paste the following code. For the second line, <Google Drive upload folder ID>, create an upload folder in Google Drive in advance and obtain its ID.
Next, click the “+” button in the upper left of the screen and select HTML.
Click the “Deploy” button in the upper right of the screen, then click “New deployment.”
Click the gear icon and select “Web app.”
Set “Execute as” to yourself and “Who has access” to everyone.
Proceed with the authorization.
A warning screen like the following will appear. Click “Advanced.”
Click the “Go to …” link.
As a result, the following screen will be displayed. Access the URL at the bottom of the screen.
You can access a web app like the following.
When you upload a file, a time-based folder will be created in the Google Drive folder whose ID you specified earlier, and the uploaded file will be stored inside it.
I introduced how to create an anonymous file uploader using Google Drive and Google Apps Script.
If you want to change the target upload folder ID, you can edit “Code.gs” and perform a “New deployment.” However, in this case, a new URL will be issued. If you want to continue using the URL from the previous version, you can change the version specification from “Manage deployments.”
For details, please refer to the following article.