Forum Moderators: open

Message Too Old, No Replies

PDF file for download or viewing link issues

pdf file for download or viewing link not working

         

MrWhippy

7:48 pm on Feb 24, 2009 (gmt 0)

10+ Year Member



Hi all,

I have tried google and searching on webmaster world, everything seems to be pointing to the same thing.

The problem is that I can not get a pdf file to be available to download or view via a link.

I have tried using a normal link to the file i have tried using a link with the word file in it. everything seems to point to a normal link should work.

Does anyone have any ideas please.

tedster

8:07 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is the server's mime type set propoerly for a pdf file?

sonjay

9:37 pm on Feb 24, 2009 (gmt 0)

10+ Year Member



What happens, exactly? You make a link like so: <a href="pdffilename.pdf">My pdf file</a>, and then you upload that file to the server, and you upload the pdf file itself, and when you click that link, what happens then?

phranque

9:55 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



what HTTP response headers are you sending with the pdf file?
you might want to make sure the following are specified:
Content-Type: application/pdf
Content-Disposition: attachment; filename="example.pdf"

MrWhippy

11:10 pm on Feb 24, 2009 (gmt 0)

10+ Year Member



thanks for the answers all,

i get a 404 error.

sonjay yes that is how it is set up at the moment,i have tried straight in public and in a seperate folder, not sure if i can edit the mime types on the server will have a look and see.

also phranque i will look into setting the headers with it. Do i do that in the link, htaccess or somewhere else.

thanks for your time all

sonjay

12:31 am on Feb 25, 2009 (gmt 0)

10+ Year Member



If you're getting a 404 error, then your link is wrong. You need to make sure you upload the pdf to the server, and you need to make sure the link to the pdf is correct. The filename in the link must exactly match the filename of the pdf itself, and you should not have any blank spaces or "funky" characters in the filename. If your site is on a unix server, filenames and paths are case-sensitive: e.g., if your pdf is named "MyPDF.pdf" but you link to "mypdf.pdf" you'll get a 404.

MrWhippy

8:17 am on Feb 25, 2009 (gmt 0)

10+ Year Member



H Sonjay,

sorry I told a lie when i said it was a 404 the error i get is actually
"
Not Found

The requested URL /downloads/cheklist.pdf was not found on this server.
"
Sorry I was very tired when I was posting last night

MrWhippy

8:43 am on Feb 25, 2009 (gmt 0)

10+ Year Member



Fixed the problem,

thanks for all your help.

If you look at the post above it was a stupid typo from being tired i think. sorry to have troubled you all.