mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Merge pull request #4873 from SupSuper/shared-drives
Fix Google Drive uploader null response fields
This commit is contained in:
commit
97df3a052a
1 changed files with 2 additions and 10 deletions
|
@ -253,16 +253,8 @@ public override UploadResult Upload(Stream stream, string fileName)
|
|||
|
||||
string metadata = GetMetadata(fileName, FolderID, DriveID);
|
||||
|
||||
Dictionary<string, string> args = new Dictionary<string, string>();
|
||||
args.Add("uploadType", "multipart");
|
||||
args.Add("fields", "id,webViewLink,webContentLink");
|
||||
if (!string.IsNullOrEmpty(DriveID))
|
||||
{
|
||||
args.Add("supportsAllDrives", "true");
|
||||
}
|
||||
|
||||
UploadResult result = SendRequestFile("https://www.googleapis.com/upload/drive/v3/files", stream, fileName, "file", args,
|
||||
GoogleAuth.GetAuthHeaders(), contentType: "multipart/related", relatedData: metadata);
|
||||
UploadResult result = SendRequestFile("https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&fields=id,webViewLink,webContentLink&supportsAllDrives=true",
|
||||
stream, fileName, "file", headers: GoogleAuth.GetAuthHeaders(), contentType: "multipart/related", relatedData: metadata);
|
||||
|
||||
if (!string.IsNullOrEmpty(result.Response))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue