Hi,

I am at my local collage and am learning to make a web page by writing HTML in notepad.

I have a link on my page that I want to open a Word document, my line is:-
<p>This is my entire work history so far <a href ="file:///newcv.doc"> Ian's CV</a>

The link is there but doesnt work, can sombody help me.

Dani AI

Generated

linked a Word file from a local path and discovered it only opened on the machine where the file lives. That is expected: file URIs point to a local filesystem and are not a reliable way to share documents on the web (they only work where the file exists) — see RFC 8089.

To make the CV available to others, place the document on a web server and link to it over HTTP(S). Using relative paths (keep the document in the same site folder or a subfolder) avoids hard-coded machine names and makes moving from development to production simpler — this is the approach suggested. If the file must be downloaded rather than opened in-browser, the server can send a Content-Disposition: attachment; filename="..." header or a same-origin link can use the download attribute; both control whether the browser opens or saves the file (MDN: download attribute, MDN: MIME types).

Quick troubleshooting checklist:

  • Test via a web server, not just double-clicking the HTML file. For local testing you can start a simple server (for example, python -m http.server from the folder).
  • Check the browser dev tools network tab for 404/403 and verify the exact URL being requested.
  • Use forward slashes in URLs (Windows backslashes are not URL separators).
  • Avoid spaces in filenames (or percent-encode them) and confirm file permissions so the webserver can read the file.
  • If you need broad compatibility, consider publishing a PDF instead of a Word document.

Responses from , , and pointing toward hosting the file were on the right track; 's comment about an HTML spacing error is a red herring here.

Recommended Answers

All 7 Replies

<a href ="file:///newcv.doc"> Ian's CV</a>

The above line will not work.

You should give something as

<a href =""> Ian's CV</a>

It didnt work either, but this did.

<p>This is my entire work history so far <a href ="file:///***file location***\newcv.doc"> Ian's CV</a>.

thanks any way

:)

Is it required that you use an absolute path? If not, I recommend using a relative path. It's just less icky.

<a href ="file:///newcv.doc"> Ian's CV</a>

File from your computer not work

you can upload free hosting .....

ex
<a href =""> Ian's CV</a>

ur not suppes to have a space its supposed to be <a href="">text</a>

The file has to be on the server. Nothing else can find a file that is saved on your own computer.

yes you need an absolute path in other words not coming from your drive but a web address upload the file to a domain via ftp then link from there as stated above if you link from your hard drive when other try to view it it wont be on thier harddrive

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.