Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3920 มุมมอง

Hi,

I want a button for download a file in my server. Odoo 14 server and file to download are same server. For example my file is in " /home/web/web.pdf " on website when I press the button I want to download web.pdf.
How can I link it?


many thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

To keep it simple, you can link your buttons to filehosting/filesharing platforms (Nextcloud, Drive, ...) where you host your files and share them for download.

BR

Ricardo

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You need to write a controller to return the download response. You can refer to this function in Odoo for downloading PDF reports.

@http.route(['/report/download'], type='http', auth="user")
def report_download(self, data, token, context=None):

In your case, you have to browse the file and return the download response.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ส.ค. 24
1866
2
ก.ย. 15
7314
2
ก.ค. 25
1352
1
พ.ค. 25
838
2
พ.ค. 25
1461