ebizzle Posted October 17, 2007 Share Posted October 17, 2007 Hi there! Ok...I am at a loss. I have been trying to find a good resource on how to force a download when someone clicks on a link on my page. Now I am very new to this and im just asking for some basic understanding on how this process works. I guess my problem is I dont even understand the process so I wouldent know what questions to ask. From my research I have think the process involves making a .txt file that has the download instructions saving that file in the same directory as the file you would like to download, and reference that file in your index script so that when I click on a link the browser tells the server to run that script thus starting the download. Please advise I am so frustrated but I dont want to give up. Im sure some of you have been in my shoes. Thanks so much for your advice. Your friend, Ebizzle ??? Quote Link to comment https://forums.phpfreaks.com/topic/73700-im-at-a-loss-with-a-simple-download-script/ Share on other sites More sharing options...
ebizzle Posted October 17, 2007 Author Share Posted October 17, 2007 i know you may not want to take the time...i just want you to know i am just trying to learn. Quote Link to comment https://forums.phpfreaks.com/topic/73700-im-at-a-loss-with-a-simple-download-script/#findComment-371866 Share on other sites More sharing options...
leet8845 Posted October 17, 2007 Share Posted October 17, 2007 Why would you want to force a download? Quote Link to comment https://forums.phpfreaks.com/topic/73700-im-at-a-loss-with-a-simple-download-script/#findComment-371923 Share on other sites More sharing options...
ebizzle Posted October 18, 2007 Author Share Posted October 18, 2007 Sorry...bad writing. Basically I want a link oin my page that someone can click and have a window pop up asking if they would like to save or run....force was a bad word to use.. Quote Link to comment https://forums.phpfreaks.com/topic/73700-im-at-a-loss-with-a-simple-download-script/#findComment-372008 Share on other sites More sharing options...
leet8845 Posted October 18, 2007 Share Posted October 18, 2007 Just upload the file you want people to have to the root folder of your website using your FTP programme or your server control panel. Then create a link in your HTML editor as normal but put /yourfile.exe after the link. E.g Link: http://www.yourwebsite.com/yourfile.exe (or which ever file format your using) This will automatically generate a pop-up window asking to run or save when a user clicks the link/button/advert to download the file. Do you understand what I explained? Quote Link to comment https://forums.phpfreaks.com/topic/73700-im-at-a-loss-with-a-simple-download-script/#findComment-372016 Share on other sites More sharing options...
PHP_PhREEEk Posted October 18, 2007 Share Posted October 18, 2007 This will automatically generate a pop-up window asking to run or save when a user clicks the link/button/advert to download the file. Do you understand what I explained? Well, not exactly... some media items like mp3 or mpg will automatically run in the defined player on the user-end. You have to write specific code to force these things to be prompted for saving. I don't know if that's the problem he's having or not, but thought I'd mention it. Obviously .exe, .zip etc will prompt, but some do not (without some coding). PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/73700-im-at-a-loss-with-a-simple-download-script/#findComment-372061 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.