Zen Cart Logo
Forums / General Questions / Add a link to a .pdf

Add a link to a .pdf

Views: 2,634

Results 1 to 9 of 9
8 Aug 2010, 11:39 AM
#1
nintendoparts avatar

nintendoparts

New Zenner

Join Date:
Jul 2010
Posts:
49
Plugin Contributions:
0

Add a link to a .pdf

I am having trouble adding a link to a .pdf file

All I want to to is have a link to a 'returns_form.pdf' file so customers can download the .pdf and fill it out when returning faulty items.

I have uploaded the 'returns_form.pdf' to the 'images' folder and I have tried code that look like this:

please download our <a href="/images/returns_form.pdf">returns form<a/>

and I have also code that looks like this:

please download our <a href="http://www.nintendoparts.com.au/images/returns_form.pdf">returns form</a>

When I click on the link it keeps coming up with my custom 404 page saying the page does not exist. The file is definitely at that location, I have checked and double checked with filezilla, I just can't get it to download.

I want it to download the .pdf when the link is clicked. It seems like such a simple process but I can't get it to work. If anyone has any ideas what I'm doing wrong that'd be great!

I'm running Zen Cart 1.39d with the following addons:
Zen Lighbox
Module Manager
ImageHandler
Sitemap XML
Google Analytics
Simple SEO URL's

8 Aug 2010, 11:47 AM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Add a link to a .pdf

Did you check for any mis-spelling such as returns-form.pdf or return_form.pdf ? Seems too simple but sometimes these little typos are absolute buggers ....

8 Aug 2010, 12:16 PM
#3
nintendoparts avatar

nintendoparts

New Zenner

Join Date:
Jul 2010
Posts:
49
Plugin Contributions:
0

Re: Add a link to a .pdf

Thanks for the quick reply :)

I checked, double checked, and triple checked all the spellings, even changed the file to form.pdf and the code accordingly to simplify the spelling, still same problem, I also tried linking to a .zip and the same thing happens.

I have linked to a .jpeg files in the image directory to test I was linking to the correct directory and the .jpeg links work no problems. I just can't link to .pdf or .zip files.

Any more ideas?

8 Aug 2010, 12:25 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Add a link to a .pdf

I don't know if this affects anything but customer uploads, but it can't hurt to check the permitted file types in includes/classes/upload.php.

Only other thing I can think of would be to make sure you're naming the file .pdf and not .PDF.

Also, when you navigate your browser directly to the file (http: //www.yoursite.com/images/yourfile.pdf) does it load ?

8 Aug 2010, 12:37 PM
#5
nintendoparts avatar

nintendoparts

New Zenner

Join Date:
Jul 2010
Posts:
49
Plugin Contributions:
0

Re: Add a link to a .pdf

I got it to work by placing the .pdf in the root directory :)

I don't know why it didn't work when placed in the image directory, in theory it should have. Oh well, at least customers can download the form now, that's good enough for me.

Thanks for the help though guys!

9 Aug 2010, 3:58 AM
#6
natedigby21 avatar

natedigby21

New Zenner

Join Date:
Aug 2010
Posts:
1
Plugin Contributions:
0

Re: Add a link to a .pdf

Nintendoparts:

I got it to work by placing the .pdf in the root directory :)
credit card application
I don't know why it didn't work when placed in the image directory, in theory it should have. Oh well, at least customers can download the form now, that's good enough for me.

Thanks for the help though guys!

Adding the file type format in the root directory will certainly provide the solution to this kind of problems.

Good to know everything working fine now.

Regards,

11 Aug 2010, 1:46 AM
#7
pdxdoug avatar

pdxdoug

Zen Follower

Join Date:
Jan 2008
Location:
Portland, Oregon USA
Posts:
356
Plugin Contributions:
0

Re: Add a link to a .pdf

I link to a directory named infosheets with this code from an EZ page:

<a  href="http://www.mysite.com/infosheets/DonationForm.pdf"></a>
```Permissions same as regular ZenCart:
755 directories 644 file
Form is opened by Acrobat and the customer can print it.
14 Jan 2011, 9:25 PM
#8
tonyv avatar

tonyv

New Zenner

Join Date:
Oct 2007
Posts:
28
Plugin Contributions:
0

Re: Add a link to a .pdf

actually what I found was the htaccess file in the images directory did not have allow pdf in the list of allowed files. It was working fine until a recent update so I am thinking that is when it was left out. add pdf in the list and you will be back in business. :cool:

14 Jan 2011, 10:33 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Add a link to a .pdf

If .pdf was removed from the list of allowed filetypes, it was most likely for security purposes. I would consider carefully before allowing it if you don't need to. Might there be a better folder to put it in, maybe /downloads/?