How to Upload Files to Google Form

Last Updated : 26 Aug, 2024

Are you looking to enhance your Google Forms by allowing respondents to upload files? Whether you’re collecting resumes, project proposals, photos, or any other file types, enabling file uploads in Google Forms can make your data collection process more efficient.

In this article, you’ll learn how to enable the file upload option in Google Forms and how to store those submissions directly in Google Drive. Let’s get into the step-by-step instructions on creating a file upload form in Google Forms.

How-to-Upload-Files-to-Google-Form
How to Upload Files to Google Form

What is a File Upload Feature in Google Forms?

The file upload feature in Google Forms allows users to easily upload documents, images, videos, and more directly through the form. This feature is ideal for collecting multiple file types in scenarios like job applications, homework submissions, and project reports. Once uploaded, these files are automatically stored in Google Drive, making it easier for you to organize and manage submissions efficiently.

How to Create a Google Form for File Uploads

Follow these steps to create a Google Form with file upload capabilities:

Step 1: Open Google on your default web browser.

Search for Google on your device's default web browser. 

upload files Google Forms
Open Google on your default web browser

Step 2: Open Forms from Google Workspace apps

Click on FORMS from the 9-dot menu bar at the top right corner of the Google homepage.

upload files Google Forms
Open Forms from Google Workspace apps

Step 3: Open a Blank form and rename it 

Select a blank form from the window and rename it to Upload files to Drive. 

upload files Google Forms
Select a blank form from the window

Step 4: Give the untitled question a name

In the box given below, rename the question as needed.

upload files Google Forms
Give the untitled question a name

Step 5: Add options to the question

By clicking the "add option" or "add other," you can add various options.

upload files Google Forms
Add options to the question

Step 6: Click the required symbol    

There is a Required button in the bottom right corner. To make the question required, click Required.

upload files Google Forms
Click the required symbol

Step 7: Click Add Symbol on the top right corner      

If you are done with your question, click the add symbol in the vertical bar on the right side of the page.

upload files Google Forms
Click Add Symbol on the top right corner to add questions

How to Enable the File Upload Option in Google Forms

Enabling the file upload option is straightforward. Follow these steps:

Step 1: Select the file upload option and continue

In the question type dropdown menu, choose “File Upload.”

upload files Google Forms
Select the file upload option

Step 2: Click on "Continue"

Click on the Continue Button

upload files Google Forms
Click on "Continue"

Step 3: Enter the details of the files to be uploaded

Two questions will be asked regarding the file, the size of the file, and the number of files to be uploaded. Choose and continue.

upload files Google Forms
Enter the details of the files to be uploaded

Step 4: Click the required symbol     

There is a Required button in the bottom right corner. To make the question required, click Required.

upload files Google Forms
Click the required symbol

There are two methods through which you can Link a Google Forms to Google Drive.

Method 1: Using the Apps Script

Method 2: Run the Script

How to Create the Apps Script in Google Form

Follow the below steps to create the Apps Script in Google Form:

Step 1: Open the script editor in the form

Three dots are given in the top right corner of the form. Click "More" to open the dialogue box. Select "Script editor" from the options.

upload files Google Forms
Open the script editor in the form

Step 2: Click the untitled project on the top

Click the untitled project name at the top of the window. Rename the project to "Upload files to Drive".

upload files Google Forms
Click the untitled project on the top

Step 3: Rename Project

upload files Google Forms
Rename the project

Step 4: Create another file in the Apps Script     

This step is optional, both code sections can be placed in the same script file. If you prefer separation, follow these steps:

  • Click on "File" in the menu bar.
  • Select "New" and then "Script file".
  • Name the new file "Setup".
upload files Google Forms
Create another file in the Apps Script

Step 5: Give File Name

upload files Google Forms
Name the file Setup.

Step 6: Replace the last content with the given one

Replace the content of both script files with the following content:

// Replace "Form Name" with the ID of your form.

var form = FormApp.openById('YOUR_FORM_ID');

var folderId = 'YOUR_FOLDER_ID'; // Replace with the ID of the folder in Google Drive where you want to store the files.

// This function is triggered every time the form is submitted.

function onFormSubmit(e) {

var responses = e.response.getItemResponses();

// Loop through each form response.

for (var i = 0; i < responses.length; i++) {

var response = responses[i];

// Check if the response is a file upload question.

if (response.getItem().getType() == FormApp.ItemType.FILE_UPLOAD) {

var fileBlob = response.getResponse(); // Get the uploaded file.

var folder = DriveApp.getFolderById(folderId);

var fileName = response.getItem().getTitle(); // Use the question title as the filename.

folder.createFile(fileBlob).setName(fileName); // Save the file to Google Drive.

}

}

}

upload files Google Forms
Replace the last content with the given one

How to Run the Script in Google Form

Get the Form and Folder IDs. To run the script, here are the steps:-

Step 1: Replace form ID

Replace 'YOUR_FORM_ID' with the ID of your Google Form. You can find this ID in the URL of the form.

upload files Google Forms
Copy the URL to replace 'YOUR_FORM_ID'
upload files Google Forms
Press Ctrl+V to replace the Form ID

Step 2: Replace folder ID

Replace 'YOUR_FOLDER_ID' with the ID of the folder in your Google Drive where you want to store the files. If you don't have the ID, you can get it from the URL when you're in the folder.

upload files Google Forms
Replace folder id

Step 3: Replace Form ID

upload files Google Forms
Press Ctrl+V to replace the Folder ID

Step 4: Save Script

Save the script.

upload files Google Forms
Save the script.

Step 5: Click triggers

Click on the clock icon (Triggers) in the script editor toolbar.

upload files Google Forms
Click triggers

Step 6: Set up a trigger

Set up a trigger to run the 'On Form Submit' function every time the form is submitted.

upload files Google Forms
Click on "Add Trigger"

Step 7: Select a Trigger and Click "Save" Button

upload files Google Forms
Set up a trigger to run the 'on Form Submit'

Benefits of Using Google Forms and Google Drive Integration for File Uploads

  • Easy access and sharing: As soon as the file is uploaded, accessing it and sharing it among collaborators is straightforward. It also has a significant function that lets users control who can view, edit, or comment on the files.
  • Automatic organization: Google Drive provides various features, such as folders, tags, and more, that make it easy to find specific files. Users can also customize folders to categorize the uploaded files and search for them specifically.
  • Security and backup: Google Drive has strong security that protects all the uploaded files. 
  • Centralized storage: Every file uploaded using Google Forms is appropriately stored in Google Drive. This ensures that all related files and data are arranged in one location, which helps with control and access.
  • Version control: Google Drive automatically saves file versions so users can access older versions when necessary. This feature is beneficial when several people work on the same file, as the changes can be monitored and reversed.

Conclusion

Enabling file uploads in Google Forms and integrating them with Google Drive is a powerful way to streamline data collection. Whether you’re gathering documents, images, or videos, these features provide a secure, organized, and efficient solution for managing submissions. Start creating your own file upload forms today and make your data collection process more effective!

Comment