0

I have written my own software to access "Google Drive" and I am seeing that even providing a MIME framing, Google will happily write a partial file if the HTTP connection is severed.

I am USING the API as a POST to "https://www.googleapis.com/upload/drive/v3/files" indicating 'uploadType': 'multipart', a "content-type": "multipart/related" headers and a correctly formatted MIME multipart file. So, it is trivial for Google to detect that the file is incomplete but, apparently, it is not doing it. It is trivial because a MIME multipart upload has a particular trailer that will be missing if the upload is incomplete.

My Questions:

  • Is there anything I can do so Google doesn't store partial files?. A MD5 header, maybe? A content-length header?.

  • If not, is there any way to detect it (searchable metadata, maybe) beside my program "knowing" that a particular file upload was partially done?. Maybe the "CHANGES" API?.

Thanks for your time in advance!.

PS: I could do a "save to another filename" + "rename to the correct filename when you are sure that Google has the complete file" but then I would upload half speed because latency (yes, I could do pipelining) and, WORSE, waste half of my scarce API rate limits. If there is no other choice...

0

This was a mistake in my code. Google seems to work as expected.

Sorry for the noise, I beg your pardon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.