Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3924 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
aug. 24
1869
2
sept. 15
7314
2
iul. 25
1361
1
mai 25
842
2
mai 25
1464