views:

160

answers:

3

I have a simple PHP script that will either serve up a streaming ASF file or not, depending on whether you're logged in and have access to the file. It basically does this:

<?php

header('Content-Type: video/x-ms-asf');
header('Content-Disposition: inline; filename="file.asf"');
readfile('file.asf');

?>

This already works fine in Firefox; when you navigate to this file it starts the video streaming right away. But Internet Explorer is a different story. When I go to this link in IE, it consistently tries to download the file as if it were an attachment rather than streaming it in the browser. What I am missing that IE's getting hung up on?

A: 

From your description, it sounds like your IE is configured to save a .asf file rather than stream it. Perhaps you can try opening a similar file on your local drive in IE to check whether it's configured to stream it.

Noufal Ibrahim
+1  A: 

It look like that your IE or Media Player isn't correctly configured. Check this link link text for more details.

Zied
+1 for the link
Noufal Ibrahim
+1  A: 

I don't think you need to add the Content-Disposition. Did you try removing it?

webdestroya
I'm not sure why this worked, but it worked. Setting Content-Disposition to "inline" is supposed to tell the browser explicitly not to download the file, but it seems IE doesn't handle that properly. So just removing that instruction worked!
SoaperGEM
Glad it worked! Thanks for the bounty
webdestroya