Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3899 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
srp 24
1857
2
zář 15
7307
2
čvc 25
1317
1
kvě 25
830
2
kvě 25
1444