Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Download vs. play?

Reply
Thread Tools

Download vs. play?

 
 
Anil Gupte
Guest
Posts: n/a
 
      11-07-2004

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


 
Reply With Quote
 
 
 
 
Paxton
Guest
Posts: n/a
 
      11-07-2004

"Anil Gupte" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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..."


 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      11-07-2004
Hi Anil,

You can "force-feed" the file back to the browser as described here.
http://www.aspfaq.com/show.asp?id=2161

Ray at home

"Anil Gupte" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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?



 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      11-07-2004
Paxton wrote on 07 nov 2004 in microsoft.public.inetserver.asp.general:
> "Anil Gupte" <(E-Mail Removed)> wrote in message
>> 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?

>
> 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..."


Oh, but it can be done with ASP. Use as mime type:

Response.ContentType = "application/asp-unknown"

<http://www.google.com/search?q=ADODB+ASP+force.download>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

 
Reply With Quote
 
Paxton
Guest
Posts: n/a
 
      11-07-2004

"Evertjan." <(E-Mail Removed)> wrote in message
news:Xns959AE73C31450eejj99@194.109.133.29...
> Paxton wrote on 07 nov 2004 in microsoft.public.inetserver.asp.general:
>> "Anil Gupte" <(E-Mail Removed)> wrote in message
>>> 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?

>>
>> 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..."

>
> Oh, but it can be done with ASP. Use as mime type:
>
> Response.ContentType = "application/asp-unknown"
>
> <http://www.google.com/search?q=ADODB+ASP+force.download>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress,
> but let us keep the discussions in the newsgroup)
>


<!--Has now added a new bookmark -->


 
Reply With Quote
 
Anil Gupte
Guest
Posts: n/a
 
      11-08-2004
Fantastic! I am sure with all these resources, I can find one that works
for me. Thanx all!

--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
http://www.velocityreviews.com/forums/(E-Mail Removed)
www.keeninc.net
www.icinema.com
"Anil Gupte" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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
>



 
Reply With Quote
 
Anil Gupte
Guest
Posts: n/a
 
      11-11-2004
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 Removed)
www.keeninc.net
www.icinema.com
"Anil Gupte" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Fantastic! I am sure with all these resources, I can find one that works
> for me. Thanx all!
>
> --
> Anil Gupte
> k.e.e.n., inc.
> Milwaukee, WI
> (E-Mail Removed)
> www.keeninc.net
> www.icinema.com
> "Anil Gupte" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> 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
>>

>
>



 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      11-11-2004
Is E: a local drive on the server?

Ray at home

"Anil Gupte" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> OK, I failed. Can someone tell me what is going wrong in this code?
>
> <%


> FPath = "e:\icinema.com\movies\raigarh\" & fn
> Response.AddHeader "Content-Disposition", "attachment; filename=" & fn
>
> Set adoStream = CreateObject("ADODB.Stream")
> chunk = 2048
> %>
>
> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where download download java.awt.robot class Rafal Majda Java 5 04-18-2005 05:00 PM
problem with code download file - two window file download Sam -- ASP .Net 2 03-17-2005 04:20 PM
Re: How can I display a download link in my (C#) ASP.NET web form to download a file stored in my sql db? Steve C. Orr [MVP, MCSD] ASP .Net 0 03-07-2005 07:14 PM
File upload/download from database. Download appends aspx page to end of file Ryan Taylor ASP .Net 2 11-10-2004 08:31 PM



Advertisments