Re: php force MP3 'save as' dialog
- From: "Karl" <nospam>
- Date: Wed, 24 Jan 2007 21:52:38 -0000
sorry, so looking throught seems quite similar to my version
does your version bring up the more standard "downloading" box (with a
progress bar and time remaining)
"Steve" <no.one@xxxxxxxxxxx> wrote in message
news:wNPth.33$eK3.29@xxxxxxxxxxxxxxx
| if(ini_get('zlib.output_compression')) {
| ini_set('zlib.output_compression', 'Off'); }
takes longer to check the 'if' condition than to just call
ini_set()...setting it 'off' has no effect when it is 'off' and, has the
correct effect when it is 'on'. further, iirc, if it is 'on', it comes to
the browser compressed but the browser uncompresses it once it is all
received. if the browser doesn't support compression, none of this matters
anyway.
| header("Pragma: public");
| header("Expires: 0");
| header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
| header("Cache-Control: private",false);
| header("Content-Type: audio/x-mp3");
| header("Content-Disposition: attachment;
| filename=\"".basename($FileURL)."\";" );
| header("Content-Transfer-Encoding: binary");
| header("Content-Length: ".filesize($FileURL));
these are the headers i usually use...although i have used force-download
before as well (sorry for the wrapping):
require_once 'site.cfg.php';
$fileData = '';
$fileName = $_REQUEST['fileName'];
$filePath = $site->uploadBaseDirectory;
if ($fileName != ''){ $fileData = @file_get_contents($filePath .
$fileName); }
header('pragma:
);
header('expires:
);
header('cache-control: private',
);
header('cache-control: must-revalidate, post-check=0,
ck=0' );
header('content-disposition: attachment; filename="' . $fileName .
);
header('content-size: ' .
);
header('content-transfer-encoding:
);
header('content-type:
);
echo $fileData;
.
- Follow-Ups:
- Re: php force MP3 'save as' dialog
- From: Steve
- Re: php force MP3 'save as' dialog
- References:
- php force MP3 'save as' dialog
- From: mail
- Re: php force MP3 'save as' dialog
- From: Steve
- php force MP3 'save as' dialog
- Prev by Date: Re: Http_output
- Next by Date: Re: php force MP3 'save as' dialog
- Previous by thread: Re: php force MP3 'save as' dialog
- Next by thread: Re: php force MP3 'save as' dialog
- Index(es):
Relevant Pages
|