Download vs. play?

A

Anil Gupte

Hi!

this may be a trivial question, and may not even involve asp, but let me
try....

I want people to click on a .wmv file on a website and download it.
Currently, when they do that it simply launches windows media player and
tries to play the file there. Any ideas?

Thanx in advance.
--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
www.keeninc.net
www.icinema.com
 
P

Paxton

Anil Gupte said:
Hi!

this may be a trivial question, and may not even involve asp, but let me
try....

I want people to click on a .wmv file on a website and download it.
Currently, when they do that it simply launches windows media player and
tries to play the file there. Any ideas?

Thanx in advance.
--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
www.keeninc.net
www.icinema.com

You're right - it doesn't involve ASP. Put an instruction on your web page
for visitors to right-click on the link to the .wmv file and "save target
as..."
 
A

Anil Gupte

OK, I failed. Can someone tell me what is going wrong in this code?

<%
Response.Buffer = False
Server.ScriptTimeout = 30000

Response.ContentType = "application/x-unknown" ' arbitrary
fn = "raigarh.wmv"
FPath = "e:\icinema.com\movies\raigarh\" & fn
Response.AddHeader "Content-Disposition", "attachment; filename=" & fn

Set adoStream = CreateObject("ADODB.Stream")
chunk = 2048
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(FPath)

iSz = adoStream.Size

Response.AddHeader "Content-Length", iSz

For i = 1 To iSz \ chunk
If Not Response.IsClientConnected Then Exit For
Response.BinaryWrite adoStream.Read(chunk)
Next

If iSz Mod chunk > 0 Then
If Response.IsClientConnected Then
Response.BinaryWrite objStream.Read(iSz Mod chunk)
End If
End If

adoStream.Close
Set adoStream = Nothing

Response.End
%>

I copied this from http://www.aspfaq.com/show.asp?id=2161 and saved it to a
file called download.asp However, when I click on the link to Download.asp,
it says it "cannot download download.asp". On Windows XP I do not get even
that, just a page cannot be displayed message.

Please help, I am desperate now!

Thanx,
--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
(e-mail address removed)
www.keeninc.net
www.icinema.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top