Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1539 Lượt xem

I would like to add a button to download a static zip file in the website, but I didn't find how.

Is there a way to obtain the link to a binary attachment stored, or something else useful ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Yes, you could build that link by yourself for example to download the attachment with id=517

/web/content/517

/web/content/517/filename.txt

If the binary file it's associated with a model field, for example res.users​ with id=56​ on field attach_file​ you could build the url like this:

/web/content/res.users/56/attach_file

/web/content/res.users/56/attach_file/filename.txt

Then you need to be able to generate a link to that url file in your website page

Ảnh đại diện
Huỷ bỏ