Adding .doc or .txt Files to Websites

What to Know

  • First, make sure the hosting service allows .doc or .txt files.
  • To add the file, upload the file > find the URL > choose a location > find the location in your HTML > add the link.

Have you created a .doc file using Microsoft Word, or .txt file using the text editor on your computer that you think your readers will benefit from? Her's how you add it to your website so your readers can open it or download it.

Illustration of hand reaching out with a text document

FoxysGraphic / Getty Images

  

Make Sure Your .doc or .txt Files Are Allowed

Some hosting services don't allow files over a certain size. Make sure that what you are about to add to your website is allowed by your web hosting service first. You don't want to get your website shut down for not following the rules or do a lot of work getting ready to add the .doc or .txt file to find out you can't.

If your hosting service does not allow you to have large files on your site, and you need to upload a large file, you can get your own domain name for your website or switch to another hosting service that does allow large files on websites.

Upload a .doc or .txt File to Your Website

Upload your .doc or .txt files to your site using the easy file upload program that your web hosting service provides. If they don't provide one, then you need to use an FTP program to upload your .doc or .txt file to your website.

Find Your .doc or .txt File's Address (URL)

Where did you upload the .doc or .txt file to? Did you add the .doc or .txt file to the main folder on your site or to another folder? Or, did you create a new folder on your site just for .doc or .txt files? Find the address of the .doc or .txt file on your website so you can link to it.

Choose a Location for Your .doc or .txt File

Which page, and where on the page, do you want the link to your .doc or .txt file to be? You should decide where you want the link to the .doc or .txt file to show on the page.

Find the Location of the .doc or .txt File in Your HTML

Look through the code on your webpage until you find the spot where you want to add the link to your .doc or .txt file. You may want to add

before you enter the code, for the link to your .doc or .txt file, to add a space.

Add the Link to the .doc or .txt File

Add the code to the place where you want the link to the .doc or .txt file to show up in your HTML code. It's actually the same link code that you would use for a normal webpage link. You can make the text for the .doc or .txt file link say anything you want it to.

Example

Your website is hosted at Freeservers.

The username for your site is "sunny."

Your site is located at http://sunny.freeservers.com

You uploaded the .doc file to the main directory in your file manager on your site.

The .doc file is called "flowers.doc".

The text you want the reader to click on to download the .doc file is "Click here for the .doc file called flowers."

Your code will look like this:

Click here for the .doc file called flowers.

If it is a .txt file instead, then the code will look like this instead:

Click here for the .txt file called flowers.

If you had uploaded the .doc file to a folder called "fun," the code for the link to the .doc file would look like this instead:

Click here for the .doc file called flowers.

If you are using a .txt file instead, then the code will look like this:

Click here for the .txt file called flowers.

Testing the .doc or .txt File Link

If you are creating your website on your computer, before downloading the site and the .doc file to your server, and you want to test the link to the .doc file to make sure it works right, you will need to link to the .doc file on your hard drive like this:

The .doc file is located in the My Documents folder

It is called "flowers.doc"

The text for the .doc file says "Click here for the .doc file called flowers."

The code is:

If you are using a .txt file instead, then the code will look like this:

Format
mla apa chicago
Your Citation
Roeder, Linda. "Adding .doc or .txt Files to Websites." ThoughtCo, Nov. 18, 2021, thoughtco.com/add-doc-or-txt-files-to-web-sites-2654718. Roeder, Linda. (2021, November 18). Adding .doc or .txt Files to Websites. Retrieved from https://www.thoughtco.com/add-doc-or-txt-files-to-web-sites-2654718 Roeder, Linda. "Adding .doc or .txt Files to Websites." ThoughtCo. https://www.thoughtco.com/add-doc-or-txt-files-to-web-sites-2654718 (accessed March 19, 2024).