M
MattC
Hi,
I have the following code in the code behind for a page. I use it to
deliver a video without the user being able to view the direct address in
the media player properties. It works fine on IE and Firefox, but
Mac/Safari seems to not like the fact that the content-type is different
from teh file exptension type it has registered.
Any ideas how this can be circumvented?
TIA
MattC
private void Page_Load(object sender, System.EventArgs e)
{
string mode = Convert.ToString(Request.QueryString["mode"]);
if(mode == "deliver")
{
//get the filename and location
string filelocation = Server.MapPath("vid.wmv");
Response.Clear();
Response.ContentType = "video/x-ms-wmv";
Response.AddHeader("Content-disposition", "filename=vid.wmv");
FileStream fs = new FileStream(filelocation,FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Response.BinaryWrite(br.ReadBytes(Convert.ToInt32(fs.Length)));
Response.Flush();
}
}
I have the following code in the code behind for a page. I use it to
deliver a video without the user being able to view the direct address in
the media player properties. It works fine on IE and Firefox, but
Mac/Safari seems to not like the fact that the content-type is different
from teh file exptension type it has registered.
Any ideas how this can be circumvented?
TIA
MattC
private void Page_Load(object sender, System.EventArgs e)
{
string mode = Convert.ToString(Request.QueryString["mode"]);
if(mode == "deliver")
{
//get the filename and location
string filelocation = Server.MapPath("vid.wmv");
Response.Clear();
Response.ContentType = "video/x-ms-wmv";
Response.AddHeader("Content-disposition", "filename=vid.wmv");
FileStream fs = new FileStream(filelocation,FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Response.BinaryWrite(br.ReadBytes(Convert.ToInt32(fs.Length)));
Response.Flush();
}
}