I'm trying to add title info when uploading file but request not giving error and upload success still title not setting. Also when i tried to set permissions with post multipart it was not working too therefore used post json request. I can't use json when uploading file so i don't know how to handle this.
Source code (Upload method): https://github.com/ShareX/ShareX/blob/master/UploadersLib/FileUploaders/GoogleDrive.cs
I'm using this same post multipart codes for around 25 different uploading services and it only not works in Google Drive.
When i add "?uploadType=multipart" to url it giving this error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badContent",
"message": "Unsupported content with type: application/octet-stream"
}
],
"code": 400,
"message": "Unsupported content with type: application/octet-stream"
}
}
But content type is:
multipart/form-data; boundary=--------------------8d110c071a9b453
So i can upload files successfully also i can set permission with json request but unable to set title.
Also i'm wondering is it possible to set permission in upload request or second request is always required?
Instead i used https://www.googleapis.com/drive/v2/files/{fileid} for set title and parents.
This require second request but have no choice, because can't set metadata while uploading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With