ArunaStorage / aruna

The data orchestration engine
https://aruna-storage.org
Apache License 2.0
16 stars 1 forks source link

MIME type not set with S3 upload #147

Closed mzur closed 4 months ago

mzur commented 7 months ago

Maybe related to https://github.com/ArunaStorage/DataProxy/issues/30.

If I upload files via S3, no MIME type is set. Even if I explicitly upload/modify the type:

$ s3cmd put -m 'image/jpeg' -r so242_1_83_subset2 s3://biigletest/
$ s3cmd modify -m 'image/jpeg' s3://biigletest/so242_1_83_subset2/20150814_080600_IMG_37001.JPG

it is not set:

$ s3cmd info s3://biigletest/so242_1_83_subset2/20150814_080600_IMG_37001.JPG
s3://biigletest/so242_1_83_subset2/20150814_080600_IMG_37001.JPG (object):
   File size: 641698
   Last mod:  Tue, 27 Feb 2024 09:47:53 GMT
   MIME type: none
   Storage:   STANDARD
   MD5 sum:   01HQMZ6W995TF1S6VGFC5YG96D
   SSE:       none
   Policy:    none
   CORS:      <?xml version="1.0" encoding="UTF-8"?><CORSConfiguration><CORSRule><AllowedHeader>*</AllowedHeader><AllowedMethod>GET</AllowedMethod><AllowedOrigin>https://biigle.de</AllowedOrigin><MaxAgeSeconds>30</MaxAgeSeconds></CORSRule></CORSConfiguration>
   ACL:       none

I noticed this because BIIGLE checks the MIME type before it creates an image collection. This must have worked before (as I have created collections successfully in the past). Maybe I'm doing something wrong?

St4NNi commented 7 months ago

Hi Martin,

Thanks for reporting. Yes this looks like a bug, in previous iterations HeadObject was unimplemented. Many S3 clients use GetObject as a fallback if HeadObject fails, GetObject should make use of the automatic mime type detection of the underlying HTTP lib, but HEAD does not. Since we are currently preparing a last major update to the data proxy before 2.0 full release anyway I will put his on the list.

St4NNi commented 7 months ago

Should be fixed when 21ab971 goes live. At least the first part that auto guesses the mime type. The active override will follow in a future update.

mzur commented 7 months ago

Will you close this when it is live? Then I can test it again.

St4NNi commented 7 months ago

Yes, this was the plan.

St4NNi commented 4 months ago

Sorry for the long wait this was merged a long time ago. Please go ahead and test it and just let us know if it still does not work.