1. Home
  2. Computing & Technology
  3. Web Design / HTML

Write a Download Link

By Jennifer Kyrnin, About.com

Sometimes you have items on your website that you want your customers to be able to download to their home computer. Things like large documents and PDF files, long videos, or songs. But most files are automatically opened in the browser window rather than saved as a download file.

This how to will explain two ways to do it - an easy way and a slightly harder way. The first requires that your readers do most of the work, while the second requires that you do a little work to the file to download.

Difficulty: Average
Time Required: 10 minutes
Here's How:
  1. Upload the file to be downloaded to your Web server. Make sure you know where it is by testing the full URL in your browser window.
    /documents/large_document.pdf
  2. Edit the page where you want the link and add a standard anchor link to the document.
    <a href="/documents/large_document.pdf">Download the large document</a>
  3. Add text next to the link telling your readers they need to right-click the link in order to download it.
    Right-click the link and choose "Save Link As..." to save the document to your computer
  4. If your readers ignore that step, you can adjust the file to something that will be automatically downloaded by most browsers: a zip file or compressed file.
  5. Use your operating system compression program to turn your download file into a zip file.
  6. Upload that zip file to your Web server. Make sure you know where it is by testing the full URL in your browser window.
    /documents/large_document.zip
  7. Edit the page where you want the link and add a standard anchor link to the zip file.
    <a href="/documents/large_document.zip">Download the large document</a>
Tips:
  1. Most operating systems have some compression software built in. If yours doesn't, you can look up "zip files" in a search engine to find a program to build them for you.
  2. You can use this technique for images, movies, music, and documents as well as PDF files. Anything you can compress as a zip file you can post to your site for download.
What You Need:
  • The file to be downloaded.
Explore Web Design / HTML
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. Beginning HTML Tutorials
  6. How to Write a Download Link - Links to Download Files Rather than Display Them>

©2009 About.com, a part of The New York Times Company.

All rights reserved.