I want to load a document on a website. How can I add a document as a link? The document is on my PC. I would be grateful if you can help me


<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>


Replace this line with your code.

<do not remove the three backticks above>

document is a broad term, what? A text file (.txt), a docx file? pdf? gif? jpg? epub?

It is not impossible to achieve this, but it would mean opening your pc to the internet so the file can be accessed, which if you do it wrong you have a massive security problem. I don’t recommend it. I recommend to upload it somewhere, and depending on the sort of file how to display it on the webpage

1 Like

Thank you for your help.As far as I understood you recommend me to upload it to my website and then display it through the website. How can I do that in a safe way?

you only part of my question, how should it be displayed? What type of file is it? Good answers requires good questions

Is this outside codecademy? What do you have? Languages available?

1 Like

They are Microsoft Word documents (type) . In these documents there are questions of level PET and FCE. It will be a kind of practising English website. My purpose is to load them to my website, share them free and make people have an access to these documents. I mean if I can load my documents to the website there will be links and people have a chance to click the link and download the documents with those links ( display the documents). Unfortaunately because of the fact that I started creating a website today I don’t know how can I do that. Also I am new at coding. These documents are outside of the codeacademy. They are on my PC. I could not understand your last question unfortaunately. I am appreciate for trying to help me. I hope I succeed to explain your question’s answers. Thanks again.

you can’t display a word document on a webpage, download is made easy this day.

lets say i have a index.html and test.docx in the same directory i can simple do:

<a href="test.docx" download>click me</a>

to make this accessible you would need to host your html files (check the community -> tips and resources section on the forum, which will help you)

i assume you know how to use a <a></a> elements, so you can also put the doc files on dropbox, google drive and link to it (untested)

1 Like

Thanks for your all help. I am grateful for them.