Forum Moderators: coopster
<br />
<b>Warning</b>: filesize(): Stat failed for fmailtxt (errno=2 - No such file or directory) in <b>/home/xeno/public_html/fmaildownload.php</b> on line <b>4</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/xeno/public_html/fmaildownload.php:4) in <b>/home/xeno/public_html/fmaildownload.php</b> on line <b>4</b><br />
<br />
<snip>snipped other "headers already sent" lines<snip>
<b>Warning</b>: readfile(fmailtxt): failed to open stream: No such file or directory in <b>/home/xeno/public_html/fmaildownload.php</b> on line <b>10</b><br />
Thanks for help. btw I have no white spaces and the code is on a new page. I don't know what is wrong.
[edited by: coopster at 10:13 am (utc) on July 9, 2005]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]
In order to *force* a download you need to send the browser the appropriate header [php.net](s). It seems you are getting a WARNING message pushed to the browser before your headers and therefore you are receiving the header errors.
You are going to need to fix that filesize function on line 4 before you will get to the next step. Looks like the file is not being found. Maybe you want to check for the file existence (is_file [php.net] and/or file_exists [php.net]) before trying to get it's size?