0
votes

I am trying to make a "Save as" to google drive functionality for my web app. The user is shown the Google Picker and chooses a file to save over. At this point the application is updating the content of the file successfully, but it doesn't change the mimeType of the file being overwritten.

The api reference specifies the following about the mimeType metadata: "The MIME type of the file. This is only mutable on update when uploading new content [this is the case]. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type."

I am leaving it blank. In fact, I am doing a simple upload to PUT https://www.googleapis.com/upload/drive/v2/files/{fileId}. And the http request has the Content-Type header set to the mimeType of the file being uploaded. In this case (if this helps) is "application/vnd.ms-project". I also tried adding the uploadType=media parameter to the url, with no success.

I also tried making a multipart update using the Api playground. Sent the metadata content empty {} and the error message was "Unsupported content with type: application/vnd.ms-project". Funny it is unsuported because I did manage to create a new file with the same mimeType, with no problem.

What to do? Any sugestions?

1
Is the file you're trying to modify a Docs file?Burcu Dogan

1 Answers

0
votes

You can't replace an existing native Docs file with a regular blob. The only way to update a docs file with a blob is switching on the Docs conversion which is not possible for a Microsoft Project file.