x_maras Posted June 23, 2009 Share Posted June 23, 2009 Hi, I'm making a small application which produces a text file and then the user should click on a download button. In the download button I say onClick=window.open('text.txt'); When I click it the txt opens in a new tab and shows the text in the browser. I would like to make it to be downloaded to the users pc. Is this possible? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/163413-download-button/ Share on other sites More sharing options...
sKunKbad Posted June 24, 2009 Share Posted June 24, 2009 Read this: http://apptools.com/phptools/force-download.php Quote Link to comment https://forums.phpfreaks.com/topic/163413-download-button/#findComment-862414 Share on other sites More sharing options...
haku Posted June 25, 2009 Share Posted June 25, 2009 I personally use this one: http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/ It's always worked well for me. Quote Link to comment https://forums.phpfreaks.com/topic/163413-download-button/#findComment-863125 Share on other sites More sharing options...
x_maras Posted June 25, 2009 Author Share Posted June 25, 2009 I was searching something like this. Thank you both, they are more than enough. Quote Link to comment https://forums.phpfreaks.com/topic/163413-download-button/#findComment-863270 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.