You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ContentType detection and Tests for upload ExtraArgs (#35)
* enable server-side bucket to bucket copies
The 'copy_object' method permits setting different source and target buckets. When different, a server-side copy takes place between the buckets.
Appropriate ACLs must exist in AWS, but this is a quick method for copying keys between buckets within the same account and region.
Copying across regions and/or accounts is more complex, and is not enabled with this change.
* Allow settable extra_args for uploads and downloads
Allow setting upload and download `extra_args` values for the lifetime of the filesystem instance.
Ticket #32 has details
* Moved args to constructor and removed bucket copy
* load unquoted json if value is a string
* Expose `acl` and `cache-control` directly and via opener
* Small cleanup
* (bugfix) Only set if value exists
* Boto3 changed from `extra_args` to `ExtraArgs` at some point
This has been tested and works.
I uploaded a file to a private bucket, setting the max-age and ACL.
* Add ContentType Detection with fallback
The boto3 `upload_fileobj` never guesses the ContentType (unlike other Boto3 methods). So all files are stored as `binary/octet-stream`.
This can problematic when uploading images or audio, and expecting it to load inline.
`guess_type` is a lightweight guesser, that only looks at filenames. If this implementation fails to identify a type, it falls back to the defaults `binary/octet-stream`
* moved ContentType to ExtraArgs
The `client.upload_fileobj` method has `ContentType` in ExtraArgs.
* moved _upload_args to method to inject ContentType
* Add tests for upload ExtraArgs
* fix typo
* Fix TypeError if ContentType manually set
* fixes#38
0 commit comments