Upload a file to Google Drive
Input
attachment requiredThe file to upload.
filename optionalName 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 optionalDestination folder id, the <id> in drive.google.com/drive/folders/<id>. Omit to upload into the root of My Drive.
ifExists optionalWhat 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 requiredThe name the file has in Drive. With keepBoth, the numbered name Drive gave it.
fileId requiredId of the uploaded file. With replace, the id of the existing file that got a new version.
folderId requiredId of the folder the file is in.
mimeType requiredThe file's type in Drive.
replaced requiredTrue when the upload became a new version of an existing file.
url optionalLink that opens the file.
sizeBytes optionalSize of the stored file.
