InMotion Hosting Support Center

When creating a website, occasionally there will be a need to hotlink to a file on the server. Hotlinking (or direct linking) is when a link uses the url to link, as apposed to linking to the directory relative to the file. An example of this is show in the following:

Link relative to the file location on the server:
<img src="/support/image.jpg" />

File Hotlinked or Directly linked to the server:
<img src="" />

This is especially useful when using the Premium Web Builder. The Web Builder has the File download link; however, the problem with the File download link is that the file is accessible by everyone on the web. Hotlinking to the file allows the folder to be password protected, preventing people from accessing the file. This is common for those selling books in PDF format that only want people who paid for the book to download it. Lets learn how to directly link a file to the website.

Directly linking to a file on the server

  1. Log into cPanel
  2. Go to the File manager and navigate to the folder where the file will be uploaded.

    In this tutorial, a .jpg image will be uploaded to the myimage directory. If there is no directory to upload the file to, create the directory and upload the file there. Upload the file to the folder.

    For information on how to upload files through the cpanel File Manager click here

  3. link-to-file-server-2-index-ofNow that the file is uploaded, the file directory can be accessed. If visiting the directory in the browser With indexing set to default On, the directory will list the file on the page. See snapshot to the right.

    Visit the file through the browser by going to:

    Where the "foldername" is replaced with the folder name on your server and the "filename.file" is replaced with the file that was uploaded to that directory.
  4. link-to-file-server-3-urlGet the url from the address bar of the browser. In this example the url will look like the following:

    The url can be used in anchors, images, and other HTML tags where files can be linked to. Below are some examples of code that can be used.

    A download link or hyper link will use the following:
    hyper link

    Hotlinking an image to your website uses the following:
    <img src="" />

If you missed the last article, please see the tutorial on Anchor Links and How to Create Them. For more information about articles with a similar topic, please visit Inserting Links into a Website.

Was this article helpful?
Continued Education in Course 103: Inserting Links into a Website
You are viewing Section 5: Hotlink or Direct link to files on the server
Section 4: Anchor Links and How to Create Them

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

n/a Points
2018-04-02 7:17 am


I want to link an image from my web disk to my HTML signature, but the image isn't fetched. It shows access denied or 404 not found.

How can I use my cPanel and web disk to share files for different uses

42,946 Points
2018-04-02 9:07 am
Sorry for the problems with your image. If you follow the instructions above, then it should work. Note that HTML signatures will only appear if the viewer is using an email client that can view the HTML version of the email. You can't force people to read only the HTML version. You should be using a fully qualified path like "" . It may also depend on how you set it up with your email client.

n/a Points
2017-09-15 12:27 pm

Awesome job on the query responses :)

So here's mine - Once i uploaded my file to the Cpanel (a pdf document) and visited the address on the browser, the file got downloaded directly. How do i make the document viewable on the browser, instead of downloading

3,862 Points
2017-09-15 1:09 pm

Thanks for your feedback. In regards to your question about embedding a PDF file rather than downloading it, that would heavily depend on how you built the website. If you are using HTML coding, you may be able to try following our guide on How to Add a PDF File to Your Website.

Otherwise, if you are using WordPress or Joomla, for example, you may find capabilities built in or a plugin or module to assist in embedding PDFs. I hope this helps!

Carlos E
n/a Points
2016-01-26 12:26 am

i have an html game i purchased, the instructions say to upload the gamw folder directly to my server, however i've created a dreamweaver website and want users to be able to play that game from my website. where do i find the link from my server  that i can link on my website?


11,043 Points
2016-01-26 11:04 am
You'll see in Step 2 above how you can open the cPanel File Manager. Once you created a folder and added the game files you can link to it with your domain and the name of the directory you put the files in. For example:

In this case "gamefolder" would be the name of the directory with the game files in it.
n/a Points
2015-10-21 1:05 am

Hey guys,

Awesome job on the query responses :)

So here's mine - Once i uploaded my file to the Cpanel (a pdf document) and visited the address on the browser, the file got downloaded directly. How do i make the document viewable on the browser, instead of downloading?



42,946 Points
2015-10-21 12:11 pm
Hello Alex,

Thanks for asking this question about embedding a PDF file into your website. There are a number of ways to make this happen. Google allows you embed the PDF directly into an iFrame. You could also use an embedder script such PDFObject. Hopefully, this will provide a few options for your website.

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

Arnel C.
n/a Points
2015-10-18 8:41 am

i uploaded html files on free webhosting site.. after uploading when i clicked on the html file then its shows the local adress like "file:///C:/Users/xvxvxv/Downloads/index.html"... instead of link... so what should i do to get the link of index file???

43,761 Points
2015-10-19 5:15 pm
Hello Nauman,

You would change that code in the link references of the html and possibly css files.

Kindest Regards,
Scott M
n/a Points
2015-03-06 1:25 am
very very good.
42,946 Points
2015-02-16 11:19 am
Hello Soham,

Thanks for the question. Since it appears that your newsletter is in HTML format, you will need to upload the HTML file and all of its image elements into your web hosting account. You will need to have a web page or an email that references the link to the HTML page. When you upload a file onto the webserver, you will need remember WHERE you placed it so that you can properly reference it. For example, if your domain name is and you are placing files in the default location (in an InMotion Hosting account), then the files would uploaded into the PUBLIC_HTML folder. If the HTML file was named newsletter.html, then the path would be

Here are some great reference guides on how to upload files:

Getting started with FTP
Using the File Manager in cPanel.

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

Arnel C.
n/a Points
2015-02-16 12:34 pm

Cpanel wont let me upload an entire folder,so do i need to use ftp instead? And can you explain how to do this using an email?

31,595 Points
2015-02-16 1:05 pm
Hello Soham,

Thank you for your question. You cannot connect to FTP using an email address, but you can connect with your cPanel username/password.

If you need additional FTP account, or do not want to share your cPanel credentials, you can create FTP accounts in cPanel.

Thank you,
n/a Points
2015-02-16 10:07 am

How do i upload a newsletter? Its has a .html file and a folder containg the images

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

17 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!