OCA / storage

GNU Affero General Public License v3.0
66 stars 148 forks source link

[16.0][FIX] fs_attachment: respect controller parameters for /web/content/ #365

Closed hbrunn closed 1 month ago

hbrunn commented 2 months ago

when we craft a link like

/web/content?model=my.model&filename_field=filename&field=binary_field&mimetype=mime.type&filename=myfile.name

the parameters are ignored and the resulting download gets the generic (wrong) name/mimetype from the attachment of the binary field if it is of type fs. For filestore attachments, this happens in ir.binary#_get_stream_from, so I think we need to do the same thing for fs attachments. Otherwise, we can't really use this as drop-in replacement for storing binary fields in object storage.

OCA-git-bot commented 2 months ago

Hi @lmignon, some modules you are maintaining are being modified, check this out!

lmignon commented 2 months ago

Thank you for the fix @hbrunn Can you I a unittest to check that it works in the initial case and with fs_attachment?

hbrunn commented 2 months ago

/ocabot rebase

OCA-git-bot commented 2 months ago

Congratulations, PR rebased to 16.0.

lmignon commented 1 month ago

/ocabot merge patch

OCA-git-bot commented 1 month ago

This PR looks fantastic, let's merge it! Prepared branch 16.0-ocabot-merge-pr-365-by-lmignon-bump-patch, awaiting test results.

OCA-git-bot commented 1 month ago

Congratulations, your PR was merged at f4a28295f09c4feb56644d613972d2126e990a89. Thanks a lot for contributing to OCA. ❤️