Hi,
I have a sql database that stores media files (.avi f.e.). I extract the video in a aspx page (VIDEOPAGE) as a byte array and send it to another web page calling this one (It has to be this way), and showing the video using an html object tag presenting a windows media player control.
The syntax I use is:
Response.ContentType = contentType;
Response.AddHeader("Content-Disposition", string.Format("attachment; filename ={0}",myAttachment.FileName));
Response.OutputStream.Write(myAttachment.Attachment, 0, myAttachment.Attachment.Length)
This works perfectly fine for all mpeg and wmv files, but fails on avi!! The contentType variable contains the CORRECT content type (and this I know because of the following:
When I don't use an object tag but simply load the VIDEOPAGE page with an avi file from the database and the above syntax, it displays a "do you want to open.." dialog box, I click ok, and the video DOES SHOW in WMP.
I tried to change the Content-Disposition
to hidden
and also inline
. Nothing..
Any ideas?