You are here: Re: php force MP3 'save as' dialog « All PHP « IT news, forums, messages
Re: php force MP3 'save as' dialog

Posted by Karl on 01/24/07 21:52

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@example.com> wrote in message
news:wNPth.33$eK3.29@newsfe04.lga...
>| 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;
>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация