Download static file from link on screen

Hello! I need download static file from inside project.
I try to make link on screen and after click on the link i need download PDF file on my computer. Now when i click on link PDF is open in new window on Chrome web browser.

Have you solved this ? If yes, could you share you solution ?:grinning:

i dont have solution :frowning:

I manage to resolve this by adding header add_header Content-Disposition "attachment;"; to the external pdf link:

code in Nginx:

     location /download {
           proxy_pass    ;
           proxy_cookie_path /download /download;
           add_header Content-Disposition "attachment;";
           proxy_set_header Cookie $http_cookie;

You can try to customize the cuba.web.viewFileExtensions property
(see documentation)

PDF files are opened in browser by default.

Thanks for sharing, Irina~

My senario is that we provide two button: one is view and another is download, which provide different behavior.

Anyway this may help Zgar’s case :slight_smile: