camptocamp/odoo-cloud-platform

V12 attachment_s3 : SVG wrong content-type on S3 --> upgrade extra arg boto3

cyrilmanuel opened this issue · 3 comments

We have an issue when we upload some picture SVG to the S3 in odoo V12.

Context :
we need to upload SVG file to the S3 and display the image in an image_URL field on the view

error case :
When we uploaded SVG files in the S3 bucket, the content-type is not "image/svg+xml" but "octet-stream". when we display the the file from the url, odoo return an error " image can't be displayed".

Possible solution
the problem is that the content type seems to be wrong or not passed with the file to the bucket S3. As discussed with @gurneyalex , @yvaucher this can be update by adapting boto3 request to pass extra parameters ( metadata) : https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-uploading-files.html

It's done with this PR : https://github.com/camptocamp/odoo-cloud-platform/pull/404/files

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@cyrilmanuel I don't remember, is this specific to v12 or does it need forward porting to later versions?

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.