Connecting Tech Pros Worldwide Help | Site Map

how to download wmv file

  #1  
Old August 18th, 2008, 10:05 PM
Gerald
Guest
 
Posts: n/a
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.ContentType = "application/xunknown"
Response.AddHeader "content-disposition","attachment;
filename=http://www.facethewind.com/videos/may29_01.mpg"
set adoStream = Server.CreateObject("ADODB.Stream")
adoStream.Type = 1
vUrl = "URL=http://www.facethewind.com/videos/may29_01.mpg"
chunk = 2048
adoStream.Open vUrl, adModeRead
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 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.asp from www.test.com
Internet Explorer was not able to open this Internet site. The requested
site is either unavailable or cannot be found.


  #2  
Old August 19th, 2008, 12:55 AM
Jeff Dillon
Guest
 
Posts: n/a

re: how to download wmv file


"Gerald" <gm@dataforcesoftware.comwrote in message
news:%23ksO0TXAJHA.1180@TK2MSFTNGP04.phx.gbl...
Quote:
>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.ContentType = "application/xunknown"
Response.AddHeader "content-disposition","attachment;
filename=http://www.facethewind.com/videos/may29_01.mpg"
set adoStream = Server.CreateObject("ADODB.Stream")
adoStream.Type = 1
vUrl = "URL=http://www.facethewind.com/videos/may29_01.mpg"
chunk = 2048
adoStream.Open vUrl, adModeRead
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 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.asp 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


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
.wmv file downloading farukcse answers 8 March 24th, 2009 07:17 AM
Import txt file with vertical fields into access db Roberto Mora answers 4 March 7th, 2008 03:45 PM
Using ASP page to download .wmv file RJT answers 1 November 19th, 2005 03:09 AM
Force Download of wmv-file luigi.zala@freesurf.ch answers 0 November 19th, 2005 12:47 AM