How to add a PDF file to your website

In this article I’m going to show you how to add a PDF (Portable Document Format) file to your website.

Linking to a PDF file

Most novice website users are aware that you can link off to another website or webpage from your own website. However they can become confused when they try to figure out linking to a PDF document that they might need to share.

It’s actually a very simple process to link to a PDF file, if you’ve linked to another webpage before than you should have no issues at all figuring it out, as it’s essentially the same process.

If you are simply trying to directly type out a HTML link to a PDF document, you would use the following format, in this example our sales.pdf document is in the same directory as the HTML page we are linking to it from:

<a href="sales.pdf">Sales Figures</a>

This would create a link saying Sales figures, and when visitors click on the link, it should either open up their PDF reader automatically, or prompt the visitor to download the PDF file.

Alternative PDF linking methods

In some cases, you might not be directly modifying HTML code, and in these cases you would typically need to link to a PDF file differently. For instance if you’re using the Premium Website builder you would want to read about uploading and linking files in the Premium Website Builder.

In some cases you might also want to be able to display information from a PDF document without your visitor having to have a PDF reader installed, you could use something like Google Docs in order to accomplish this. We have a guide on how to embed a PDF in a Joomla 2.5 article that explains this process in-depth.

We recommend watching our video on How to Add a PDF File to a WordPress Post
InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

35 thoughts on “How to add a PDF file to your website

  1. Thanks for sharing information in this post. I went through and found that it really important to the user. I also have faced issues to add PDF file in our Website. This post really helped me a lot.

  2. I’m creating an index site – i.e. a page of links to many confidential documents (PDFs, docx) and recorded meetings (.mp4) – that is behind a login.  I want to store the links outside the webserver so they can not be accessed directly.  However, if the filepath is outside the webserver, it doesn’t display in the browser if I use <a href=”{local path to file}”>filename</a>.  How can I get this to work?

    1. The most common cause of this would be whatever webserver for handler not having permissions to access the files where they are currently stored, you will want to make sure whatever user your services are running as have at least read access to the directory and files.

    1. Yes, you can add files to your server using your favorite file management program. However, it is wise to leverage a third party video hosting product like YouTube or an audio hosting tool like Soundcloud. This will save resources on your server.

    2. That plugin does not seem to have the capability to embed a PDF on a website. Rather it appears that you install that plugin into your browser and it will reformat how PDFs display (on websites) in your browser.

  3. I have godaddy and need to add a link for vendors to download applications for my wedding show.  Godaddy does not have a quick access but I can create a html.  How do I create a link for them to be able to download applications or get access to attachments?

  4. Is there a way that I can tell when a file was added to a website? Is there some sort of timestamp that can track this?

    1. Hello Martin,

      I do not believe this is something you can do via the File Manager but in the command line you have the last modified column when looking at files. This shows the last time the file was updated. If you are using a script to add files then you could modify it to timestamp in a database or create a log file.

      Best Regards,
      TJ Edens

    1. Hello Taher,

      You can but most anti virus programs will try to block it by default. However if you put them in Zip files then it wont both the anti-virus until extracting when it performs its scan. What are you trying to provide as a service to users?

      Best Regards,
      TJ Edens

  5. Thanks for this article.  I’m still having a few issues though.  I am using CustomerHub to manage subscriber content.  I want to be able to have users open a pdf but CH can’t do that…only download files.  As a work around, I want to create a link that opens a new window and point it to the pdf in my File Manager with my web hosting vendor.  I did this with a quiz I created and it worked fine.  Unfortunately, I’m getting page not found.  I point it to https://mywebsitename/foldername/filename.pdf.  This should work, right?

    1. Hello Dbarttx,

      As long as your user owns the files permissions wise then yes it should. You may need to contact CustomerHub if you are using their website services.

      Best Regards,
      TJ Edens

  6. Dear sir 

    Please,  i would like to know  how to upload PDF file to my website html page,because of in my text editor page   it has not pdf  button for uplaod pdf file

    best, reguards

  7. I maintain a website for a charity. They send me a pdf newsletter which I upload and link to the appropriate page. 

    However they often contain links to an email address or other webpage or site which work if view as a pdf but not when displayed within a webpage. Is there a way to do it or will I need to rewrite the pdf as an html page? (messy!!)



    1. Hello Colin,

      Typically, you can make links within a PDF “hot” so that people can click on them and they go to where you have designated. This is normally done within the program (such as Adobe Acrobat) that made the PDF file. Otherwise, you would have to make the link to the PDF, and then a separate link outside the document, that people could click on to – or, as you were indicating, re-write everything as an HTML file.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Arnel C.

    1. Hello Ravindra,

      You may need to contact a developer to complete your project you are trying to accomplish. However can you please explain some more what you are trying to and provide a URL so we can try to point you in the right direction.

      Best Regards,
      TJ Edens

  8. hello Jacob… dont know whether this thread is still open for queries or not but…u had explained earlier the process of uploading a pdf file from a local pc to wordpress …how can we do the same in joomla ? That is I need to upload a pdf file which resides on my computer to joomla which i have hosted on my local pc.. Can u please tell me how do i go about it? Regards RK

  9. Jacob MH 

    I have spent several unproductive hours on this problem and you have explained the process so clearly that even I, a novice, can understand and follow.

    Thank you so much,


  10. Not sure if this thread is still being used, but wanted to ask a few questions about the said topic.

    My website for my business I just made has word press with it and the pdf instructions seem pretty straight forward.

    Does word press allow you to edit other things as well on an already published site?

    For Example.. adding a picture to the about me section?

    Thank you very much!!!

    1. Hello Clay,

      This article is about adding a pdf file to a webpage so I have moved your question to its own thread. You can view it here. Please make new questions in the future when not having to deal directly with the article subject.

      Kindest Regards,
      Scott M

    1. Hello Lyle,

      Just like if you would want to display an image on your website, you first need to upload the image or in this case the PDF file to the same server that your website is hosted on.

      You can do this either with FTP using a client such as FileZilla, or if your webhost is using cPanel you can upload a file using File Manager.

      If you’re using a Content Management System like WordPress to manage your site, then you would follow these steps instead:

      1. Login to WordPress
      2. Click on Posts from the left-hand menu
      3. Hover over the page you want to link to your PDF from, then click on Edit
      4. Place the mouse cursor where you’d like to add the PDF link and then click on Add Media
      5. Next click on the Upload Files tab
      6. Now click on Select Files
      7. Browse to the location on your computer with your PDF file, select it and click Open
      8. With the PDF document selected and showing a check mark now, click on Insert into page

      If you’re using WordPress, you should see that it simply creates an <a href> link as originally explained in this guide that you’re commenting on.

      Please let us know if you have any further questions. If you had any specific issues with our instructions please be as specific as possible for exactly what you’re trying to do and we’d be glad to try to point you in the right direction.

      – Jacob

  11. I have a PDF which I link to on my website.  

    When users click on a link the PDF opens on screen, how do I get it so that it either downloads or prompts the user to download instead?

    1. The PDF opening on screen is due to the user’s browser. Most modern browsers will now open PDF files on screen now instead of prompting to download the file. To download the file, the users would need to right-click the file and click Save.

    2. Hello Lyle,

      Linking to a PDF is the same as adding it your website. For instance when you’d like to place an image on your website you simply create a link to it with the <img> HTML tag.

      There is no HTML tag for directly embedding a PDF file into your website, but most web-browsers these days can simply read a PDF file directly in them. So simply using a link on your website to where you have that PDF file stored on your server should allow the visitor of your website to view that document.

      If you really wanted to display a PDF document embedded into your website, you could try to use something like the PDF.js library which uses JavaScript to display the document in place on your website. But that is going to be a much more complex setup than simply going the normal route of creating a link to the PDF.

      Please let us know if you had any further questions at all!

      – Jacob

Was this article helpful? Join the conversation!