Can't download to Mac MSIE
| From: | Brian Dunning | Date: | Fri, 19 Nov 2004 19:41:56 +0000 |
| Subject: | Can't download to Mac MSIE | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-202532@lists.php.net to get a copy of this message | ||
Hi,
Below is the code I use to provide downloads of purchased software. It has always worked great for all browsers, except MSIE for Mac (OS X and OS 9). They just receive a blank text file called getfile.php (which is the name of this doc). Can anyone suggest a way to improve this to work better and include those browsers?
header('Content-Type: '.$file_row['content_type']);
header('Content-Disposition: filename="'.$file_row["filename"].'"');
$size = filesize('../../store/files/'.$file_row['filename']);
header('Content-Length: '.$size);
header('Content-Transfer-Encoding: base64');
readfile('../../store/files/'.$file_row['filename']);
Sample data:
content_type = 'application/bin'
filename = 'software.bin'