NYCPHP Meetup

NYPHP.org

[nycphp-talk] Force download

Nathan Lavertue m2 at mutemuse.com
Tue Sep 12 14:29:06 EDT 2006


Any reason why the following script wouldn't force download the file  
in question with the appropiate name in all situations? Works in a  
few browsers, but, not while using the Internet Browser on the PSP.  
Tries to save the file 'download.php' instead of the actual video file.

Thanks

<?
header("Pragma: no-cache");
header("Expires: 0");
header('Content-Description: File Transfer');
header('Content-type: application/force-download');
$filename = "MAQ09718.MP4";

header("Content-Disposition: attachment; filename=\"".basename 
($filename)."\";" );
header("Content-Length: " . filesize($filename));

readfile($filename);
exit();

?>


Nathan Lavertue
Lead Designer & Developer - New Formats
Sony Music Studios - X Media Group



On Sep 11, 2006, at 11:53 AM, Aaron Deutsch wrote:

> Has anyone used the pear LiveUser auth classes?  Are they worth the  
> hassle of setting up and trying (also still in beta) or is there a  
> better/easier user login management tool available.
>
> thanks,
> aaron d.
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060912/92f48ec8/attachment.html>


More information about the talk mailing list