|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-14 20:51 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 00:00:02 2025 UTC |
Description: ------------ When I used session , don't download in Web browser. Reproduce code: --------------- <? // session_start(); // <= no plobrem session_start(); // <= don't download $file_name = "Download.csv"; $file_ptr = fopen($file_name, "w"); for( $i = 0; $i < 9; $i++ ) fwrite( $file_ptr, "$i, ".($i+1).", ".($i+2)."\n" ); fclose( $file_ptr ); header("Content-Disposition: attachment; filename=$file_name"); header("Content-type: application/octet-stream"); readfile($file_name); ?>