Treehouse: Grow your CSS skills. Land your dream job.

How do I link to a PDF file?

  • # April 4, 2013 at 8:10 am

    This should be easy, but I’m not sure what to do. I’m linking to the file in my HTML with a href tags.

    It works when I’m viewing the local website, but not on the published site. Is there anything I need to do to upload the file onto my website?

    # April 4, 2013 at 8:21 am

    You can simply link to the file path in your href tag. Be sure to include the PDF file on your server…

    Download PDF

    # April 4, 2013 at 8:32 am

    This is what I have:

    Course Schedule

    What would be the reason that it works locally but not on the public site?

    # April 4, 2013 at 8:45 am

    Is the pdf uploaded and available on the web, or just locally on your computer?

    # April 4, 2013 at 8:47 am


    Is the PDF file on your server? If so, is the file path correct? Personally, I like to create a folder called _Download_ and include the associated files. Using that method, your code would be as follows…

    Course Schedule

    The target=”_blank” forces the downloaded file to open in a new tab/window

    # April 4, 2013 at 9:14 am

    I’m using Google App Engine to host my site. The pdfs are in my root folder, which gets uploaded when I deploy. I’m hosting images on my site in the same way and they work fine. I’m wondering if it must be something with Google App engine, though I can’t imagine why it wouldn’t work. Hopefully I can get this to work, but in the meantime I’m probably going to have to just upload the pdfs somewhere else and link to them that way.

    # April 4, 2013 at 10:30 am

    Be specific… tell me your site address, and link to the pdf file… We cant help till let us diagnose the problem :)

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.