how to download wmv file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gerald

    how to download wmv file

    I want the user to be able to download WMV files. I get an error with the
    following code.
    Any suggestions appreciated

    Gerald


    MY CODE
    <%
    Response.Conten tType = "applicatio n/xunknown"
    Response.AddHea der "content-disposition","a ttachment;
    filename=http://www.facethewind .com/videos/may29_01.mpg"
    set adoStream = Server.CreateOb ject("ADODB.Str eam")
    adoStream.Type = 1
    vUrl = "URL=http://www.facethewind .com/videos/may29_01.mpg"
    chunk = 2048
    adoStream.Open vUrl, adModeRead
    iSz = adoStream.Size
    Response.AddHea der "Content-Length", iSz
    For i = 1 To iSz\chunk
    If Not Response.IsClie ntConnected Then Exit For
    Response.Binary Write adoStream.Read( chunk)
    Next
    If iSz Mod chunk 0 Then
    If Response.IsClie ntConnected Then
    Response.Binary Write adoStream.Read( iSz Mod chunk)
    End If
    End If
    Response.Flush
    adoStream.Close
    Set adoStream = Nothing
    Response.End

    %>

    ERROR MESSAGE
    Internet Explorer cannot download testdownload.as p from www.test.com
    Internet Explorer was not able to open this Internet site. The requested
    site is either unavailable or cannot be found.


  • Jeff Dillon

    #2
    Re: how to download wmv file

    "Gerald" <gm@dataforceso ftware.comwrote in message
    news:%23ksO0TXA JHA.1180@TK2MSF TNGP04.phx.gbl. ..
    >I want the user to be able to download WMV files. I get an error with the
    >following code.
    Any suggestions appreciated
    >
    Gerald
    >
    >
    MY CODE
    <%
    Response.Conten tType = "applicatio n/xunknown"
    Response.AddHea der "content-disposition","a ttachment;
    filename=http://www.facethewind .com/videos/may29_01.mpg"
    set adoStream = Server.CreateOb ject("ADODB.Str eam")
    adoStream.Type = 1
    vUrl = "URL=http://www.facethewind .com/videos/may29_01.mpg"
    chunk = 2048
    adoStream.Open vUrl, adModeRead
    iSz = adoStream.Size
    Response.AddHea der "Content-Length", iSz
    For i = 1 To iSz\chunk
    If Not Response.IsClie ntConnected Then Exit For
    Response.Binary Write adoStream.Read( chunk)
    Next
    If iSz Mod chunk 0 Then
    If Response.IsClie ntConnected Then
    Response.Binary Write adoStream.Read( iSz Mod chunk)
    End If
    End If
    Response.Flush
    adoStream.Close
    Set adoStream = Nothing
    Response.End
    >
    %>
    >
    ERROR MESSAGE
    Internet Explorer cannot download testdownload.as p from www.test.com
    Internet Explorer was not able to open this Internet site. The requested
    site is either unavailable or cannot be found.
    >
    Any reason not to use just an <a href..link? Right click, Save Target
    As...

    Jeff


    Comment

    Working...