Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.wmv file throwing all machine language text

Status
Not open for further replies.

spicymango

Programmer
May 25, 2008
119
CA
Hi,

I have a Window Media Video file(wmv).
It works fine if click on it and ndeia player runs it file. But when I put that fine on apache server with linix plateform. And through link on the webpage open that file. Instead of media player opening that file when I click the link.
My browser put all that machine language... Not sure why is that. Your help will be appreciated.
 
Need to add mime type (AddType) wmv probably. Google around for 'wmv mime addtype'
 
thanks a lot for your reply... I will look at mime.

One thing that is confusing me. If I do the following it works

Code:
<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"type="application/x-oleobject" width="320" height="285">
<param name="showControls" value="false">
<param name="fileName" value="[URL unfurl="true"]https://sit29w86m7.etrade.com:14101/templates/images/E_Trade_1.wmv">[/URL]
<param name="showcontrols" value="1">
<param name="showstatusbar" value="1">
<embed type="application/x-mplayer2" width="320" height="285"showcontrols="true" controller="1" showstatusbar="1" src="[URL unfurl="true"]https://sit29w86m7.etrade.com:14101/templates/images/E_Trade_1.wmv"></embed>[/URL]
</object>

if wmv entry is missing in mime, then it should not work with above code as well right?
 
No, with the above code the browser knows how to handle it.

The MIME type setting is for Apache to send in the HTTP headers when it sends a file. ie.

Code:
Content-Type: video/x-windows-media
Content-Length: 12442124

<binary data of the wmv file>

(that isn't the MIME type of WMV but it's just an example)

So when the browser gets the file, it doesn't automatically know what type of file it's going to get from the server (with the <object> tag, it does know: "application/x-mplayer2" in your <embed> tag tells the browser what type of file it can expect to be working with). Apache sends a default content-type of "text/plain" for file types it doesn't recognize, so when you do a direct link to your file, Apache says it's text/plain so your browser tries to display it inside the browser window instead of knowing to download it instead.

-------------
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top