G
Gerald
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.
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.