Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Accept other kwargs for file upload task #46

Closed
jawnsy opened this issue Sep 1, 2022 · 0 comments · Fixed by #47
Closed

Accept other kwargs for file upload task #46

jawnsy opened this issue Sep 1, 2022 · 0 comments · Fixed by #47
Assignees

Comments

@jawnsy
Copy link
Contributor

jawnsy commented Sep 1, 2022

The file upload task does not provide a content_type variable:

async def cloud_storage_upload_blob_from_file(

Hence, it relies on the default behavior of Google Cloud SDK's MIME type detection, and cannot be overridden: https://googleapis.dev/python/storage/latest/storage/blobs.html#google.cloud.storage.blob.Blob.upload_from_filename

The above documentation says that this method's MIME type detection works as follows:

Upload this blob’s contents from the content of a named file.

The content type of the upload will be determined in order of precedence:

  • The value passed in to this method (if not None)
  • The value stored on the current blob
  • The value given by mimetypes.guess_type
  • The default value (‘application/octet-stream’)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants