php header() function problem about download file
I have a file download function in my website. it works fine before. but after we moved the site to another server with runs PHP 5 (it runs on PHP 4 before). when click to download, it automatically adds a extra blank lin开发者_开发技巧e at the beginning and the end of the file which we don't want to. Here is the code for downloading function:
header("Content-Type: application/gas");
header("Cache-control: private");
header("Content-Disposition: attachment; filename=aaa.gas");
Could anyone please help me out? Thanks!
There may be an extra blank line after the ?>
that closes the PHP within the script. Exit the script after sending the file in order to prevent this from mattering.
精彩评论