pcalabria
asked on
Classic ASP Download Question
Hello Experts.....
I have a file called myinventory.csv in the downloads directory of my website.
I would like to display a hyperlink on a webpage that says download inventory.
When the link is clicked, I would like the user to be able to select a folder on his local machine,
and download the file.
Can anyone give me code to display "Download Inventory" as a hyperlink and to perform this function? The relative path of the file would be \downloads\myinventory.csv
This is what I have so far:
<a href='\downloads\myinvento ry.csv'>Do wnload Inventory</a>
I have a file called myinventory.csv in the downloads directory of my website.
I would like to display a hyperlink on a webpage that says download inventory.
When the link is clicked, I would like the user to be able to select a folder on his local machine,
and download the file.
Can anyone give me code to display "Download Inventory" as a hyperlink and to perform this function? The relative path of the file would be \downloads\myinventory.csv
This is what I have so far:
<a href='\downloads\myinvento
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both for your help!!!
I will try to write code to read the date of the file and use it as part of the name.. but that’s a project for another day!
I will try to write code to read the date of the file and use it as part of the name.. but that’s a project for another day!
ASKER
Your help is appreciated! thanks you both!
However, that link will work for anybody in the public that has the link to download inventory. Also, if somebody else runs a report that creates a file to \downloads\myinventory.csv
One option is to make sure to name the file to something unique. Perhaps concatenate the username & year & month & day & hour & second like user120191027112315.csv Or take that data and put it to an md5 hash to end up with 7344ede286decf63cd418220c6
If the file needs to be saved on the server, then save it below the public www using FileSystemObject and give your 'vault' folder write permissions for the website user account.
You are still left with the file 7344ede286decf63cd418220c6