Author Topic: Adding FTP facility to an HTML  (Read 100 times)

Offline Malcolm Bull

  • RootsChat Veteran
  • *****
  • Posts: 853
    • View Profile
Adding FTP facility to an HTML
« on: Wednesday 22 July 20 12:44 BST (UK) »
I want to allow users to download TXT and Word documents from within the pages of my Calderdale Companion.

Let's assume that my files are called

document.txt and document.docx

then what is the syntax of the HTMl code to perform this download to the user's system?

Thank you in advance

Malcolm
Surname interests:

Huntingdon: Bull / Shelford
Rotherham: Andrews / Steel
Easingwold: Snowball / Potter

Offline athacliath62

  • RootsChat Senior
  • ****
  • Posts: 377
  • Dublin
    • View Profile
Re: Adding FTP facility to an HTML
« Reply #1 on: Wednesday 22 July 20 13:02 BST (UK) »
assuming the file is in the same directory as the html page then :

Code: [Select]
<a href="document.txt">Document</a>
depends on the document options, but most browsers will display the document when clicked
you can also mention a specific save option for the link , right-click and save or similar



Offline Malcolm Bull

  • RootsChat Veteran
  • *****
  • Posts: 853
    • View Profile
Re: Adding FTP facility to an HTML *CLOSED*
« Reply #2 on: Wednesday 22 July 20 14:23 BST (UK) »
Thank you.

This works OK for the .DOCX Word document and downloads it as I want, but with the .TXT file this just opens the document and displays it on the screen, but doesn't download it.  So I'll just go with the Word document format.

Best wishes and thanks again

Malcolm Bull
Surname interests:

Huntingdon: Bull / Shelford
Rotherham: Andrews / Steel
Easingwold: Snowball / Potter