Download vs. play?

Discussion in 'ASP General' started by Anil Gupte, Nov 7, 2004.

  1. Anil Gupte

    Anil Gupte Guest

    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
     
    Anil Gupte, Nov 7, 2004
    #1
    1. Advertising

  2. Anil Gupte

    Paxton Guest

    "Anil Gupte" <> wrote in message
    news:...
    >
    > 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..."
     
    Paxton, Nov 7, 2004
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...

    > 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?
     
    Ray Costanzo [MVP], Nov 7, 2004
    #3
  4. Anil Gupte

    Evertjan. Guest

    Paxton wrote on 07 nov 2004 in microsoft.public.inetserver.asp.general:
    > "Anil Gupte" <> 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)
     
    Evertjan., Nov 7, 2004
    #4
  5. Anil Gupte

    Paxton Guest

    "Evertjan." <> wrote in message
    news:Xns959AE73C31450eejj99@194.109.133.29...
    > Paxton wrote on 07 nov 2004 in microsoft.public.inetserver.asp.general:
    >> "Anil Gupte" <> 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 :D-->
     
    Paxton, Nov 7, 2004
    #5
  6. Anil Gupte

    Anil Gupte Guest

    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

    www.keeninc.net
    www.icinema.com
    "Anil Gupte" <> wrote in message
    news:...
    >
    > 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
    >
     
    Anil Gupte, Nov 8, 2004
    #6
  7. Anil Gupte

    Anil Gupte Guest

    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

    www.keeninc.net
    www.icinema.com
    "Anil Gupte" <> wrote in message
    news:...
    > 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
    >
    > www.keeninc.net
    > www.icinema.com
    > "Anil Gupte" <> wrote in message
    > news:...
    >>
    >> 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
    >>

    >
    >
     
    Anil Gupte, Nov 11, 2004
    #7
  8. Is E: a local drive on the server?

    Ray at home

    "Anil Gupte" <> wrote in message
    news:%...
    > 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.
     
    Ray Costanzo [MVP], Nov 11, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Taylor
    Replies:
    2
    Views:
    985
    Ryan Taylor
    Nov 10, 2004
  2. Steve C. Orr [MVP, MCSD]
    Replies:
    0
    Views:
    1,647
    Steve C. Orr [MVP, MCSD]
    Mar 7, 2005
  3. Sam --
    Replies:
    2
    Views:
    644
    Sam --
    Mar 17, 2005
  4. nospam
    Replies:
    13
    Views:
    904
    André Gillibert
    Nov 18, 2007
  5. Anil Gupte

    Download vs. Play

    Anil Gupte, Nov 11, 2004, in forum: ASP General
    Replies:
    3
    Views:
    144
    Ray Costanzo [MVP]
    Nov 12, 2004
Loading...

Share This Page