What content-type for .wmv files?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry Sievers

    #1

    What content-type for .wmv files?

    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(somevi d.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
    file.

    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).

    Thanks

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

    #2
    Re: What content-type for .wmv files?

    Jerry Sievers wrote:[color=blue]
    > 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(somevi d.wmv) to send the output to the browser.
    >
    > header('Content-type: video/x-ms-wmv');
    > header("Content-disposition: inline; filename=\"$id. wmv\"");[/color]

    Hi Jerry,

    I don't really understand why you do a readfile(somevi d.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.

    HTH.

    Peter.
    --

    Comment

    • Chung Leong

      #3
      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.

      Comment

      Working...