Instructions
Educate the Reader
- Open your HTML file for editing.
- Locate the tag and navigate to the location on the page following the tag where you want to display the PDF link.
- Type the following:
Click to open or right-click and select "Save As" to download.
Substitute the name of your PDF for "file.pdf" and your desired link text for "text." This HTML code assumes the PDF file is in the same web server directory as the HTML file. Otherwise, substitute for "file.pdf" the full URL "http://www.your-domain.com/foldername/file.pdf" using your own domain and folder name.
This option educates readers and allows them to make the decision about whether or not to download and save the PDF.
Changing the File Extension
- Compress the PDF file. Most operating systems have a built-in capability to compress files. For Windows, right-click on the file, choose "Send To," "Compressed Folder." Using the Mac operating system, Control-click on the file, and select "Create Archive."
- Upload the compressed archive file to your host server in the same directory as your HTML file.
- Open your HTML file for editing. In the "" area, type"
substituting for "file.zip" your file name and for "text" your desired text label. Browsers do not automatically open zipped files but instead direct the reader to save them.
Add a Command to the .htaccess File
- Locate or create the .htaccess file in your web folder on your host's web server.
- Open the file using a text editor.
- Type the line:
AddType application/octet-stream .pdf
Save the changes and overwrite the previous .htaccess file.
4. Edit your HTML file and type in the section:
text
Substitute for "file.pdf" your file name and for "text" your desired text label. This HTML code assumes the PDF file is uploaded to the same directory as the HTML file. Otherwise, substitute for "file.pdf" the full URL "http://www.your-domain.com/foldername/file.pdf." using your own domain and folder name.
With this method clicking the link will always open the browser's download dialog window rather than opening the file for viewing in the browser.
Sponsored Links
Tips & Warnings
Back up your HTML file before editing.
The .htaccess method is not supported by Microsoft-based web servers.
No comments:
Post a Comment