Saving files to Google Drive automatically: form attachments, exports and backups

There are four ways to take files from your site or your server into Google Drive without dragging them by hand: a Google Form that accepts attachments, a Google script (Apps Script), a workflow in n8n, or a command-line program such as rclone. Which one depends on where the files come from.

Where the files come from

Source The road that usually fits Note
Attachments sent by visitors A Google Form with a file question, or a script that receives them. Attachments from strangers are a risk: limit types and sizes.
Exports of reports from the site n8n with the Drive node, or a script. Give the workflow a folder of its own.
Backups of your account A program such as rclone, in a cron job. It is software of your own; our support does not install or repair it.
Files of an application on a VPS rclone, or n8n running on the VPS itself. On a VPS all of this is yours.

The most used road: n8n with a service account

1 Create the credential at Google. As in connecting n8n to Google Sheets, but with the Drive API enabled. A service account has an e-mail address of its own.
2 Create a folder in Drive and share it with the service account’s address, as you would with a person, giving it edit permission.
3 In the workflow, use the Drive node to upload a file into that folder. The file comes from the step before: a form, an HTTP request, a read from disk.
4 Give names with dates (for example 2026-10-10-report) so two runs do not write the same name.
5 Test with a small file and confirm it appears in the folder, with the owner and permissions you expect.

Backups to Drive with rclone

rclone copies files between your server and dozens of cloud services, Google Drive among them. You set up the connection once with rclone config, and then a cron job runs something like rclone copy /home/ACCOUNT/backups drive:site-backups, where “drive” is the name you gave the connection. Follow the project’s documentation for your version, because the wizard changes.

Look after who sees the folder. Sharing with “anyone with the link” is convenient and risky: the link gets passed around. Give access to specific people and accounts. And tidy up: an automation that saves every day fills Drive, so decide from the start how long you keep files and delete the oldest, by hand or with another job.

Drive is not, on its own, a backup strategy. If a corrupted copy is copied over the good one, you lose both. Keep several dates and test a restore now and then: making and keeping your own backup, and testing that it works.
Check whose space the file uses. Depending on how the credential was created, files count against one account’s space or another’s. Confirm in Google’s documentation before automating large backups.

Need a server to run your own jobs and backups? See the VPS plans.

See the VPS servers

SEE ALSO

Automatic backups of your own application: cron and mysqldump

Connecting n8n to Google Sheets

Cron jobs: what they are for and how to create one

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?