App Logo
drive.google.com

Upload a file to Google Drive

Automatically upload a file to Google Drive on drive.google.com. Upload one file into a Google Drive folder, or into My Drive when no folder is given, and return the stored file's id, name and link. Pass filename to choose the name it is stored under. When the folder already holds a file with that name, ifExists decides: fail (the default) uploads nothing, keepBoth adds a second file with a numbered name, replace adds a new version of the existing file and keeps its id.

Input

attachment required

The file to upload.

filename optional

Name to store the file under, with its extension. Defaults to the file's own name. Pass it when you send the file as bytes, because such a file arrives named "attachment".

folderId optional

Destination folder id, the <id> in drive.google.com/drive/folders/<id>. Omit to upload into the root of My Drive.

ifExists optional

What to do when the folder already holds a file with this name. fail uploads nothing and returns an error. keepBoth stores a second file, which Drive names with a number, for example "report (1).pdf". replace uploads a new version of the existing file, which keeps its id, link and sharing.

Default: "fail"

Output

name required

The name the file has in Drive. With keepBoth, the numbered name Drive gave it.

fileId required

Id of the uploaded file. With replace, the id of the existing file that got a new version.

folderId required

Id of the folder the file is in.

mimeType required

The file's type in Drive.

replaced required

True when the upload became a new version of an existing file.

url optional

Link that opens the file.

sizeBytes optional

Size of the stored file.

FAQ

Upload one file into a Google Drive folder, or into My Drive when no folder is given, and return the stored file's id, name and link. Pass filename to choose the name it is stored under. When the folder already holds a file with that name, ifExists decides: fail (the default) uploads nothing, keepBoth adds a second file with a numbered name, replace adds a new version of the existing file and keeps its id.
Ask an AI agent connected to Reduck to run reduck/drive.google.com/upload_file, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/drive.google.com/upload_file
You do not need one. "Upload a file to Google Drive" drives the real drive.google.com pages in a browser, so it works whether or not drive.google.com offers an API for this.
Required: attachment. Optional: filename, folderId, ifExists.
It returns url, name, fileId, folderId, mimeType, replaced, sizeBytes.
Yes. It acts as you on drive.google.com: on your own Chrome it reuses your session, and on a Reduck-hosted browser it loads the drive.google.com cookies saved by the Reduck extension.
It makes changes on drive.google.com, like sending, posting, booking or buying something.
Ask an AI agent connected to Reduck to run reduck/drive.google.com/upload_file, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/drive.google.com/upload_file
It is part of Reduck's official curated catalogue.

Start building not clicking