troubleshooting Question

PHP Script Error

Avatar of dgreenjr26
dgreenjr26Flag for United States of America asked on
Microsoft IIS Web ServerPHP
13 Comments1 Solution356 ViewsLast Modified:
Im trying to write a PHP script that will allow the downloading of Windows Media Video files (.wmv) I came up with this:

header('Content-Description: File Transfer');
header("Content-type: application/force-download");  
header("Content-type: video/x-ms-wmv");
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));

The problem is that it will bring up a save as dialog box for anything else but .wmv files. I was ale to download a .mp3 and .jpg etc... but for some reason .wmv will not come up it just dies. Can anyone help me with this, maybe tell me what Im missing?
Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros