Aug 4, 2003 #1 Lotruth Programmer May 2, 2001 133 US How can I create a button that we clicked causes a file to be downloaded like the right click and save target as method used by linked files?
How can I create a button that we clicked causes a file to be downloaded like the right click and save target as method used by linked files?
Aug 4, 2003 #2 Wullie Programmer Mar 17, 2001 3,674 GB Hi mate, This will do what you want. <cfset filePath = "F:\Path\To\File.txt"> <cfheader name="Content-Disposition" value="attachment; filename=#getFileFromPath(filePath)#"> <cfcontent file="#filePath#" type="application/octet-stream"> Hope this helps Wullie http://www.necomputers.org.ukhttp://www.freshlookdesign.co.ukhttp://www.freshlookdesign.comhttp://www.whiland.co.uk The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell Upvote 0 Downvote
Hi mate, This will do what you want. <cfset filePath = "F:\Path\To\File.txt"> <cfheader name="Content-Disposition" value="attachment; filename=#getFileFromPath(filePath)#"> <cfcontent file="#filePath#" type="application/octet-stream"> Hope this helps Wullie http://www.necomputers.org.ukhttp://www.freshlookdesign.co.ukhttp://www.freshlookdesign.comhttp://www.whiland.co.uk The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
Aug 5, 2003 Thread starter #3 Lotruth Programmer May 2, 2001 133 US It did not work for me. I need something with a download button. Thanks for your help. Upvote 0 Downvote
Aug 5, 2003 #4 Wullie Programmer Mar 17, 2001 3,674 GB Just link a button to that code. Wullie http://www.necomputers.org.ukhttp://www.freshlookdesign.co.ukhttp://www.freshlookdesign.comhttp://www.whiland.co.uk The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell Upvote 0 Downvote
Just link a button to that code. Wullie http://www.necomputers.org.ukhttp://www.freshlookdesign.co.ukhttp://www.freshlookdesign.comhttp://www.whiland.co.uk The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell