Single quotes do not interpolate variables in PHP. You have also failed to properly terminate the string, probably due to putting more single quotes inside it. Try: Header('Content-Disposition: attachment; filename="'.$_SESSION['name'].'.txt"'); Kolink also points out that you should use...
I have no spaces in the filename i use for testing so I don't know if it's even needed? – Kerp Dec 13 '11 at 9:34. add a comment |.
If you use filename='downloaded.pdf', some browsers will try to save the file with the quotes in the filename.
I've written a PHP script that handles file downloads, determining which file is being requested and setting the proper HTTP headers to trigger the browser
I've seen a number of methods to force file downloads using the PHP header() function which, essentially, sends a raw HTTP header to the browser.
The cache control header is used to force the download for text files and other files even if they are opened by default inside your web browser.
Content-Disposition: attachment; filename="EURO rates"; filename*=utf-8''€ rates. As a result, we should use. <?php $filename = '中文文件名
Can't: Php header download filename. 7zip download portable apps. 224. Download map offline indonesia. Confusion. Ram milaye jodi serial title song download.
The HTTP Header string parameter is set to Content-Length: filesize=file size here. This is used to display the file size information in the download dialog box. To easily get the file size, you will use the PHP filesize( ) function and pass the filename to its parameter.
I just don't know what that header is. Thanks all for your considerd response. -----Original Message----- From: Daniel Masson Sent: Friday, August 23, 2002 8:36 AM To: firstname.lastname@example.org Subject: RE: [PHP] set filename of file open/download.