Streaming live at 10am (PST)

Button onclick direct download


#1

Hi webflow community,

I have a button that acts like a download button. I have a PDF I want the users to download when they click the button.

I uploaded the PDF to my server, but when the user clicks the button, his browser opens the PDF. I don’t want the user to be redirected outside the website, I don’t want to open a new tab either. I want that when you click the button, the file is directly downloaded and the users stays on the page.

How can I do this?

Thanks


#2

Hello @justafish

Can you share your read only link?

Here’s how > https://university.webflow.com/article/sharing-your-sites-read-only-link

For direct download you need to add a custom link attribute (download), but the download attribute can’t be added from the settings panel.

Piter :webflow_heart:


#3

Hey, I think I might have found a solution for this.
Its using Google Drive to grab the “Share Link”, but not to actually share. You grab the ID within the share link that google drive provides, and replace it with a url that simply downloads the file and never redirects the user outside the website.


#4

Hmmm sounds interesting! I will try. Thanks for sharing :webflow_heart: