fopen + wmv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm using fopen() and fpassthru()/feof() to read Windows Media Video, .wmv, files of a Win2003 server with Apache and PHP.

The file is opened and downloaded OK but is somehow corrupted.
The Windows Media Player says the file is not the correct format.

Can you see something I am missing in my code?

@ini_set("zlib.output_compression", "Off");
@ignore_user_abort();
@set_time_limit(0);

header("Content-type: application/octet-stream\n");
header("Content-disposition: attachment; filename=\"$myMediaName\"\n");
header("Content-transfer-encoding: binary\n");
header("Content-length: $myMediaSize\n");

$fp=fopen($myMediaPath, "rb");
//fpassthru($fp);
/* fpassthru is apparantly a memory-hog. Use this instead */
while(!feof($fp))
{
$buf = fread($fp, 4096);
print $buf;
}




-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 10/02/2005

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux