I have an object that contains a database record that has a FileField which points to a .pdf
, .txt
or .doc
or .docx
.
In my django template i want to create a link which when clicked opens the file, in the machines default tool for opening that file, How do i do this?
I currently have:
<a href="#">{{ object.file.name }}</a>
I would like to click this link and have the document opened.