0

I want a user to be able to download a file after entering their credentials on the webpage.

Currently I'm able to allow them download the file only if their browser has access to the hosting servers file systems. I saw this How to trigger a file download when clicking an HTML button or JavaScript.

This is what I'm doing currently:

<a href="C:\Users\me\Downloads\" download="proposed_file_name">Download</a>

Excuse my naivety. My question is this: how do I change the path to file in:

<a href="path_to_file" download="proposed_file_name">Download</a> 

such that the user can directly download to their local machine when they don't have access to the hosting servers.

Mikee
  • 783
  • 1
  • 6
  • 18
  • the file should be on the server, in the folder that contains your webpage (or a subfolder). Then you can simply link the file – Thomas Jun 24 '19 at 06:27
  • @Programnik, is your answer on the premise that since the webpage is sitting in the server, then the webpage user should have some sort of pipeline access there? – Mikee Jun 24 '19 at 06:43
  • Yes, the user should have access to the document in order to down load it. It will be in just another web site folder, the same way all the web site content is in folders. – Programnik Jun 24 '19 at 07:17

0 Answers0