What content-type for .wmv files?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
A bit OT as this could pertain to perl CGIs too, etc.

I have a php script that is hit, takes a file ID as GET
parameter... does various checks including matching PHPSESSID to make
sure the user is allowed to view the video file.

Once the script determines that all is well, it (currently) puts out
two headers content-type and content-disposition and then does a
readfile(somevid.wmv) to send the output to the browser.

header('Content-type: video/x-ms-wmv');
header("Content-disposition: inline; filename=\"$id.wmv\"");

The script is an index page which is being called like;

http://www.somdomain.com/somedir/?id=123 ...or

Anyway, the problem is Windows media player doesn't want to launch the

I'd appreciate a tip from anyone who's R&D'd this recently.  Not sure
if one or both of my headers is wrong and/or naming the index file to
index.wmv would help (I may try this next).


Jerry Sievers   305 854-3001 (home)     WWW ECommerce Consultant
                305 321-1144 (mobile    http://www.JerrySievers.com/

Re: What content-type for .wmv files?

Jerry Sievers wrote:
Quoted text here. Click to load it

Hi Jerry,

I don't really understand why you do a readfile(somevid.wmv) if you  
already send the header:
header("Content-disposition: inline; filename=\"$id.wmv\"");

Anyway, the content-type header is right; video/x-ms-wmv is the right  
content type of a wmv file.



Re: What content-type for .wmv files?

Serving large media file through PHP is often problematic. Consider
using Apache rewrite to control access instead. I've described the
method before in group. Just google it.

Site Timeline