ravi181229 Posted August 25, 2008 Share Posted August 25, 2008 Hi all, Would you guide me in writing the script for downloading a file. There will be link 'Download' and while clicking it shows a dialog box to save. Thanks & Regards, Ravi Quote Link to comment https://forums.phpfreaks.com/topic/121301-solved-file-download-script/ Share on other sites More sharing options...
genericnumber1 Posted August 25, 2008 Share Posted August 25, 2008 Why do you want a script that can download a file if you could just redirect to the file? What are you trying to do in addition to just prompting the user to download the file? Quote Link to comment https://forums.phpfreaks.com/topic/121301-solved-file-download-script/#findComment-625364 Share on other sites More sharing options...
ravi181229 Posted August 25, 2008 Author Share Posted August 25, 2008 Hi genericnumber1, If I just redirect, it opens the file on the browser. I would like user have an option to download. thanks, Ravi Quote Link to comment https://forums.phpfreaks.com/topic/121301-solved-file-download-script/#findComment-625375 Share on other sites More sharing options...
genericnumber1 Posted August 25, 2008 Share Posted August 25, 2008 I still don't understand.. <a href="mydownload.zip">Download!</a> what's wrong with this method again? You can't change how a browser handles its downloads with php... if that what's your talking about. You'll always get the dialogue from the browser with download instructions. Quote Link to comment https://forums.phpfreaks.com/topic/121301-solved-file-download-script/#findComment-625381 Share on other sites More sharing options...
ravi181229 Posted August 27, 2008 Author Share Posted August 27, 2008 Hi, <a href="mydownload.zip">Download!</a> If you write here mydownload.txt, it will not download. It will open the file on the browser itself. Quote Link to comment https://forums.phpfreaks.com/topic/121301-solved-file-download-script/#findComment-626784 Share on other sites More sharing options...
DeanWhitehouse Posted August 27, 2008 Share Posted August 27, 2008 I think you will need ajax to do it your way, as a link is normally redirecting to another page. Quote Link to comment https://forums.phpfreaks.com/topic/121301-solved-file-download-script/#findComment-626807 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.