Google Drive is the most famous cloud storage service. You get your unique account when you register for the Google Drive service, and hence to upload the files to the cloud network, you will have to log in with your credentials.
But what if you want to allow others too to upload files to your Google Drive without them being able to go through your files on your account? Here in this article, we will discuss the method to give up permission to others to upload content to your Google Drive storage.
So, read the article as it is given below, and try it out to set your Google Drive as such.
Steps to Receive Files Directly to your Google Drive
Here in this method, we will make up a regular Web form script written in HTML and CSS. We will then upload this to Google Drive using Google Scripts. This will hence help in setting your Google Drive as such so that others can also upload the content to your Google Drive cloud storage.
1. First, you will have to create the script to upload to your Google Drive. The sample form of that script is given below, but you can modify it by your own needs to add other functions or settings.
Open Notepad, copy and paste the below code, save the file as form.html, and then upload it to your google drive.
Script:
<form id="newform"> <label>Your Name</label> <input type="text" name="myName"> <label>Pick a file</label> <input type="file"name="myfile"> <input type="submit" value="Upload File" oneclick="google.script.run.uploadFiles(this.parentNode);return false;"> </form>
2. This form will create a new folder in Google Drive, where the uploaded files will be saved. This will be a public folder where anyone can upload the content to your account.
3. This form has three fields: a text field, a file input field, and a submit button. You can also modify the script to add more fields of your wish.
4. To authorize the script, you will have to open up the doGet you can either start through the Run menu. After that, you have to choose Deploy as the Web App from the publish menu that will appear. Click on the Save New version option and then select the “Choose anyone, even anonymous” option afterward.
5. You will now get a form URL from where anyone can access your Google Drive to upload the content. That’s all you will have to do, and one thing that you can do is now modify the script according to your way out and then publish it using Google Scripts, from where you will get up the URL by the same method that everyone can use to upload the content to your Google Drive cloud storage.
Note: This can be a vulnerable path for hackers to access your account files, so it is better to share the URL only with trusted users.
So, now you have learned about the method by which you can also allow others to access your Google Drive only to upload the content files. This method is safe, and you won’t have to worry about data loss or hacking of your content by anyone.