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