How to make a linka direct download PNG or PDF?

RenatoMP
New Member
1 0 0

Hello,

 

I use the Minimal theme and recently i've been working with a friend making this page inside my clothing store website. Its a "coupon" type page. We are struggling figuring out how to make a link  a direct download for anyone who click it.

 

For anyone that is kind to help me please you have to login before you can see the link. You just have to click "obtener descuento" and then "descargar cupon". This last one is the one we want to be a direct download link instead of another tab.

 

https://mehperu.com/pages/compraperu#

 

Thank you so much!

0 Likes
ScreenStaring
Shopify Partner
52 2 10

Having to create an account and login to see the page will likely discourage people from helping. 

 

In either case the first thing to do is  upload the PDF to your site. After uploading you can get the URL of the asset (see the documentation I just linked) to.

 

Is the page you want the link to appear on a Page or a part of product Liquid template?

 

If a Page, see the section here on adding a link.

 

If it's in Liquid you'll have to add the following to the appropriate template:

 

{{ 'Download Coupon' | link_to: 'https://cdn.shopify.com/s/files/path-to-your.pdf' }}

 

Or if the PDF's contents can change often but file's name remains the same:

 

{% assign pdf = 'size-chart.pdf' | file_url %}
{{ 'Download Coupon' | link_to: pdf }}

 

ScreenStaring
Software Development & Consulting
Vnsa
Excursionist
32 0 12

Thanks for the instructions and links - easy to follow !

0 Likes
William123
New Member
1 0 0

Hi all,

Could you please let me know how to create a download link that customer can directly download the file when they click on the link rather than opening inside the browser.

For example as below image, customer clicks on the "size guide", then the PDF file can be downloaded directly, rather than opening a new browswer, and click download button inside.

Thank you.

ps, here is my store: www,limkoocycling,com in debut shopify.

 
0 Likes