Upload a file to a Google Drive folder.
type: "io.kestra.plugin.googleworkspace.drive.Upload"
Examples
Upload a csv and convert it to sheet format
id: googleworkspace_drive_upload
namespace: company.team
inputs:
- id: file
type: FILE
description: The file to be uploaded to Google Drive
tasks:
- id: upload
type: io.kestra.plugin.googleworkspace.drive.Upload
from: "{{ inputs.file }}"
parents:
- "1HuxzpLt1b0111MuKMgy8wAv-m9Myc1E_"
name: "My awesome CSV"
contentType: "text/csv"
mimeType: "application/vnd.google-apps.spreadsheet"
Upload file to Google Drive
id: upload_google_drive
namespace: company.team
tasks:
- id: download
type: io.kestra.plugin.core.http.Download
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv
- id: upload
type: io.kestra.plugin.googleworkspace.drive.Upload
from: "{{ outputs.download.uri }}"
parents:
- 15OENbAxvonlASDkYyfGBftV2c0fDTmnB
name: Orders
contentType: text/csv
mimeType: application/vnd.google-apps.spreadsheet
Properties
contentType *Requiredstring
The content-type of the file
a valid RFC2045 like text/csv
, application/msword
, etc.
from *Requiredstring
The file URI to copy
description string
A short description of the file
fileId string
The file id to update
If not provided, the task will create a new file.
mimeType string
The MIME type of the file
Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published here.
name string
The name of the file
This is not necessarily unique within a folder
parents array
The destination path
readTimeout integerstring
120
The read timeout for the request (in seconds)
scopes array
["https://www.googleapis.com/auth/drive"]
The GCP scopes to used
serviceAccount string
The GCP service account key
teamDriveId string
ID of the Team Drive the file resides in
Outputs
file File
The file metadata uploaded
Definitions
io.kestra.plugin.googleworkspace.drive.models.File
createdTime string
date-time