I have successfully uploaded a local file off my computer to my Google Drive as a PDF. However, when the file was uploaded, it is labeled as Untitled and not placed in any specific folder.
$GUploadBody= @" --BOUNDARY Content-Type: application/pdf; charset=UTF-8 { "title": "$title", "parents": [{ "id":"$parentfolder" }], "mimeType": "$inputmime", "description": "$description" } --BOUNDARY Content-Type: text/plain $togoogle --BOUNDARY-- "@ How do I make it so that the file uploaded is labeled with the file name, and how can I specify a folder in my Google Drive for that file to go to?
Here is the Invoke-WebRequest cmdlet I used:
Invoke-WebRequest -uri $GUploadURI -Method Post -body $GUploadBody -Headers $Guploadheaders -ContentType "application/pdf; charset=UTF-8" -UseBasicParsing I have found the syntax for other languages like Java, but Powershell must be used for automation purposes.