I'm working on updating the metadata of a file that was previously uploaded to Google Drive. The metadata includes the title and description. However, I've noticed that when I submit the file, the name remains unchanged. The metadata seems to be added to the content of the text file instead of updating the file's actual title.
Snippet of the code being used:
$.ajax({
url: "https://www.googleapis.com/upload/drive/v2/files/---?UploadType=multipart",
data: {
title: "name...",
// other parameters specified by Google
},
headers: {
"Authorization": "Bearer ..."
},
contentType: "application/json", //as specified by Google
type: "PUT",
success: function () {
// ...
}
});
Here's how the title appears in the Google text file:
title=name...