Linking to Files
PDFs and other documents

Introduction

This document addresses linking to files for display or download. The most common use of this technique is to link to a PDF file.

SiteGrinder only copies files to your build folder when they are associated with the -xmedia, -slideshow, or -gallery hints. These are generally limited to multimedia and HTML files.

With other kinds of file links, such as PDF files, you need to do a little more management of where the file resides initially and, more importantly, where it will be once the file is uploaded.

There are two approaches, each of which will be described separately:

  1. The file is already uploaded to your site or another site on the web
  2. Use SiteGrinder's "Build to Folder" to have SiteGrinder create the link

In either case you will want to simplify the file name to make it easier for web server. In particular you will want to get rid of spaces and punctuation in the file name. Spaces can be replaced with underscores.

Thus "Jane Smith's resume.pdf" should be renamed to something like "JaneSmithsResume.pdf" or " Jane_Smiths_Resume.pdf".

When the file is already uploaded

In this situation your file is either already somewhere on your web server or is on some other site on the internet.

To link to such a file you need to know the "path" to the file.

If the file has been uploaded to the topmost directory of your own website, the same folder where your homepage HTML file is, then the path is simply the address of your website followed by the name of the file. If Media Lab has a file called "quickstart.pdf" in our top directory then the path is "http://www.medialab.com/quickstart.pdf".

Once you have the path, you will assign it to some button or other link type in SiteGrinder. This is done using SiteGrinder's Buttons Panel.

Here are the steps:

  1. Open SiteGrinder
  2. Switch to the Buttons Panel
  3. Find the button you want to link to the file in the list
  4. Click in the "Link" column next to this button
  5. Set the link type to "URL"
  6. Type or paste the path to the file into the appropriate field

Of course if you plan to manually upload the file later you can use this same technique, you just have to be careful to upload it to the same path you used in Step 6 above.

Using "Build to Folder"

In this case SiteGrinder will create the correct path to the file in the link after you locate the file using SiteGrinder's Buttons Panel.

Once you are ready to build the steps are as follows:

  1. Decide on a directory on your local disk where you want SiteGrinder to build your pages. Create a new empty folder if none exists. This will be your "Build Folder".
  2. Manually copy the file you are going to link to (e.g. a PDF file) into this build folder on your local disk. If you want to you can create a special subdirectory for this file in your build folder as long as you plan to have a directory by the same name and in the same place on your web server.
  3. Open SiteGrinder and switch to the Buttons Panel
  4. Find the button you want to link to the file in the list
  5. Click in the "Link" column next to this button
  6. Set the link type to "File"
  7. Click the button with the folder icon to locate the file in the build folder you identified in Step 1. Alternatively you can manually type or paste in the full path to the file on your local disk, but this is more error-prone.
  8. Close the Link dialog
  9. Select "Build To Folder" from the popup menu next to SiteGrinder's "Build" button
  10. Use the "Find folder" dialog that appears to locate the build folder from Step 1.

SiteGrinder will build your pages and will create the correct link to your file, even if it is inside a subdirectory of your build folder.

Once you have built your site in this way you should upload the entire contents of your build folder.

Recommendations (The best way to do it if you can get away with it!)

This task can be drastically simplified if you plan to place the file in the same directory on your website as the HTML file that contains the button linking to the file. In this case the link is always simply the name of the file.