473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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(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
http://www.somdomain.com/somedir/index.php?id=123

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/
Dec 2 '05 #1
2 15782
Jerry Sievers wrote:
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\"");


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.

HTH.

Peter.
--
http://www.phpforums.nl
Dec 2 '05 #2
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.

Dec 2 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
21
by: PassingBy | last post by:
I recently came across a template site selling cd's and was wondering what the groups opinion is of this? I purchased one of the cd's and the templates are great and Im looking forward to...
14
by: BenOne© | last post by:
Hi all, I want to create a layout with a heading at the top and two columns below it, with the left containing a menu, and the right containing the main content of the page. I'd like the heading...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
1
by: no0bodyhome | last post by:
Why am I having so much trouble positioning divs? Am I in a tables mindset here? Why doesn't content flow below or alongside where it is suppose to? I created the example below to give you...
3
by: K R | last post by:
Hi, I have generated this XML from my application. But, when I open this XML, it is throwing error. Please help me to resolve this. <?xml version="1.0" encoding="utf-8" ?> <searchResults>...
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
17
by: Mike | last post by:
I'm trying to create a page: Three sections (left, topright and bottomright), each with a heading and scrolling (overflow) content. The size of these sections should be based upon the size of the...
0
by: Tami | last post by:
Hello, I need this to call a standard url page online, not a htm, or html page in the same directory. Anyone know what its missing? Please let me know, thanks!! Tami <?php $content =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.