Continually Updating a PDF File

Tourist
6 0 2

Hi There,

 

I am wanting to attach a PDF file on my product pages that opens a new window with the PDF. My question is I need to continually update this PDF and want the link to remain the same. When I upload a new version it changes the URL so the link is no longer valid.

 

How would you go about this issue? One thought is to link it to my Box account where there is a version of the file that can be updated. Perhaps the link will remain the same that way. Any other options?

 

Thank you!

0 Likes
Shopify Partner
1657 278 347

Hi @RH_TB 

Where from you load this PDF file from shopfy server or other, generally if you want to keep same url and load different content then you have to use sub query string in url, like you have to pass and random number in url at end so browser load it everything new, other wise it load from catch.

For that you need jquery code to open url with query string. 

like: pdf_url?qry=15402

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
Highlighted
Astronaut
835 95 178

You can upload your PDF in your files and make sure it is always the same name and then use a file url to link it, this is assuming you're linking it from your product.liquid and not using the product page editor. So go to settings, files, upload your pdf and let's say it's called "my-cool-pdf", then when you link it in product.liquid you could use a file URL like:

 

<a href="{{ 'my-cool-pdf.pdf' | file_url }}">Click here to get PDF</a>

So when you upload it, delete the previous one and make sure the new one has the same name.

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes