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
Some services don't support Content-Type as a request parameter for PutObject e.g. Dell PowerScale OneFS see OneFS S3 API doc
On the other hand, some developers may prefer retrieving mime type from file content in the function AwsS3V3Adapter::mimeType() instead of getting it from HeadObject
What about creating (an optional) feature for retrieving content type from file content? Something like this:
The problem is that the mimetype (ContentType) is not stored as metadata on the object (file).
If you "solve" it by reading from the file content after the file is stored, you are going to read from the file every time any time you need it which is not great for performance. In fact, with your implementation, the adapter will read from the file content for any retrieval of any metadata (even if it's just asking for the filesize) and if you do a listContent, it will also read from all the files listed.
All in all, I think a better solution is to write a wrapper adapter that can wrap any filesystem adapter that doesn't persist mimetype internally. That wrapper can then take two other adapters, one for storing the actual file and most of the metadata, and another for storing any missing metadata in a special metadata file. The two do not even have to be pointing to the same storage pool.
Think of it as something that could be needed for any adapter, not only some S3 providers. In fact, LocalFilesystemAdapter also do not store the mimetype as metadata (and doesn't return it unless you call mimetype() explicitly), so the solution could also be an advantage here.
Feature Request
Some services don't support Content-Type as a request parameter for PutObject e.g. Dell PowerScale OneFS see OneFS S3 API doc
On the other hand, some developers may prefer retrieving mime type from file content in the function
AwsS3V3Adapter::mimeType()
instead of getting it fromHeadObject
What about creating (an optional) feature for retrieving content type from file content? Something like this:
Ideally I could the function enable/disable in the options.
The text was updated successfully, but these errors were encountered: