fr@nkie Posted November 23, 2006 Share Posted November 23, 2006 Hi. I have a link to a file and when I click then it opens, how can I directly download the file instead I open it?Here's my command:echo "The XML file was been created!. <a href=\"resultado.xml\">See the file.</a>";Thanks a lot ;) Quote Link to comment https://forums.phpfreaks.com/topic/28179-php-file-download/ Share on other sites More sharing options...
joshi_v Posted November 23, 2006 Share Posted November 23, 2006 I think you can use this for downloading a file.header("Content-type: application/binary");header("Content-Disposition: attachment; filename=resultado.xml");header("Pragma: public");header("Cache-Control: max-age=0");Regardsjoshi. Quote Link to comment https://forums.phpfreaks.com/topic/28179-php-file-download/#findComment-129003 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.