HttpError 400 on uploading 0 bytes files, 416 on downloading 0 bytes files
See original GitHub issueIt seems like the bug #241 and @Aran-Fey’s problem happened again when i trying to download and upload 0 bytes file using google drive api.
credentials = google.oauth2.credentials.Credentials(**token)
services_account = googleapiclient.discovery.build(API_SERVICE_NAME, API_VERSION, credentials=credentials)
fd= BytesIO()
media = googleapiclient.http.MediaIoBaseUpload(fd=fd, chunksize=128, mimetype='text/plain', resumable=True)
body = {'name' : 'foo.txt'}
services_account.files().insert(body=body, media_body=media, fields='id').execute()
throws
`googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/upload/drive/v2/files?fields=id&alt=json&uploadType=resumable
returned "Bad Request">`
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Files Become 0 Bytes? Top 3 Ways to Restore Zero Byte Files
This article will show you why a file becomes 0 bytes and how to restore zero bytes files on Windows computer. 3 feasible...
Read more >How To Fix the HTTP 416 Error (4 Methods) - Kinsta
Also known as the “Range Not Satisfiable” error, the HTTP 416 error can be fixed using any of the four methods in this...
Read more >Error Responses - Amazon Simple Storage Service
Error Code Description HTTP Status Code
AccessControlListNotSupported The bucket does not allow ACLs. 400 Bad Request
AccessDenied Access Denied 403 Forbidden
BucketAlreadyOwnedByYou 409 Conflict (in all...
Read more >Smoother Error Message for 0 bytes Attachment? - ServiceNow
Hi! We had a user try to upload an attachment of 0 bytes. They received a "Bad Request (400)" error: Bad Request (400)...
Read more >HTTP status and error codes for JSON | Cloud Storage
mediaDownloadRedirect, When requesting a download using alt=media URL parameter, the direct URL path to use is prefixed by /download . If this is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I missed the download part of this. Re-opening.
We confirmed that other clients fetch 0-bytes files without error, so this must be an issue with the python client.