Go Back   Computer Forums > General Computing > Hardware
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-05-2009, 10:46 AM   #1
Baseband Member
 
Join Date: Nov 2008
Posts: 24
Default How do I get my website to open a pdf outside of the visitors web browser?

I have a website with a link to a pdf. Currently, when a visitor clicks on the link, it opens the pdf inside the web browswer. I would like the the link instead to launch acrobat and open the pdf outside of their web browser.

Does anyone know how to fix this?
__________________

JAFL is offline   Reply With Quote
Old 08-05-2009, 11:48 AM   #2
Golden Master
 
01001010's Avatar
 
Join Date: Oct 2005
Posts: 7,888
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

I think it all depends on the web browser. Someone else might know the way, but I don't think you can control those circumstances.
__________________

__________________
Stop the genocide now.
↳ www.savedarfur.org

Send comments, suggestions and criticisms.
↳ 01001010listens@gmail.com
01001010 is offline   Reply With Quote
Old 08-05-2009, 11:55 AM   #3
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

Assuming you are using Apache, you can put this in a htaccess file that is in the same folder as your PDF file...

So basically, save this:
Code:
<Files *.pdf>
  ForceType application/pdf
  Header set Content-Disposition attachment
</Files>
as ".htaccess", and upload it to the same folder as your PDF files.

It should do the trick, however under linux the extension is case sensitive, so you would need to use:

Code:
<Files *.PDF>
  ForceType application/pdf
  Header set Content-Disposition attachment
</Files>
if the extention was in uppercase..
j03 is offline   Reply With Quote
Old 08-05-2009, 12:10 PM   #4
Baseband Member
 
Join Date: Nov 2008
Posts: 24
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

Quote:
Originally Posted by j03 View Post
Assuming you are using Apache, you can put this in a htaccess file that is in the same folder as your PDF file...

So basically, save this:
Code:
<Files *.pdf>
  ForceType application/pdf
  Header set Content-Disposition attachment
</Files>
as ".htaccess", and upload it to the same folder as your PDF files.

It should do the trick, however under linux the extension is case sensitive, so you would need to use:

Code:
<Files *.PDF>
  ForceType application/pdf
  Header set Content-Disposition attachment
</Files>
if the extention was in uppercase..

Honestly I'm really green when it comes to webdesign. I guess I have apache (how do I know?).

How do I save the code above? Do I copy and paste into wordpad and then save as a rtf file?
JAFL is offline   Reply With Quote
Old 08-05-2009, 12:11 PM   #5
Golden Master
 
01001010's Avatar
 
Join Date: Oct 2005
Posts: 7,888
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

http://www.thingy-ma-jig.co.uk/blog/...df-to-download

Guess there is a way. Interesting to know.
__________________
Stop the genocide now.
↳ www.savedarfur.org

Send comments, suggestions and criticisms.
↳ 01001010listens@gmail.com
01001010 is offline   Reply With Quote
Old 08-05-2009, 12:21 PM   #6
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

Quote:
Originally Posted by JAFL View Post
Honestly I'm really green when it comes to webdesign. I guess I have apache (how do I know?).

How do I save the code above? Do I copy and paste into wordpad and then save as a rtf file?
Copy it into notepad, and save it as ".htaccess" - INCLUDING the quotation marks.
j03 is offline   Reply With Quote
Old 08-05-2009, 12:34 PM   #7
Baseband Member
 
Join Date: Nov 2008
Posts: 24
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

Quote:
Originally Posted by j03 View Post
Copy it into notepad, and save it as ".htaccess" - INCLUDING the quotation marks.
I'm not having any luck. I saved the file, uploaded to my host via the file manager into the same folder as the pdf, but it doesn't work when I click on the link at the site, it still opens the pdf in the browser.

Do I need to create a seperate folder that includes just the pdf and htaccess file? Also, I noticed when I upload the .htacess file that it doesn't even show up in the file manager.
JAFL is offline   Reply With Quote
Old 08-06-2009, 08:19 AM   #8
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

It wont show up in the file manager because "dot files" are often hidden by default...

Just to confirm, you are spelling it ".htaccess" and not ".htacess" as you spelt it above?
j03 is offline   Reply With Quote
Old 08-06-2009, 01:16 PM   #9
Baseband Member
 
Join Date: Nov 2008
Posts: 24
Default Re: How do I get my website to open a pdf outside of the visitors web browser?

j03: I'm not sure why I couldn't get your method to work, but someone suggested the same method to me on another board, but with a slightly different code and ht name, and it worked. So just thought I'd pass this along:

<Files *.pdf>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>


Then, the file name was just:

.htaccess (without any quotations marks on the ends).


It worked well. Anyway, I do appreciate your help.
__________________

JAFL is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:29 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0