I have two servers. One contains the ASP web application (\\Server1) and
the other contains the data files (\\Server2).
I'm having some problem with the following "file download" code at line
"adoStream.Load FromFile(FPath) ".
The error is "ADODB.Stre am error '800a0bba' / File could not be opened."
Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTi meout = 30000
Response.Conten tType = "applicatio n/x-unknown" ' arbitrary
fn = "MyPhoto.jp g"
fpath = "\\Server2\g$\f iles\MyPhoto.jp g"
Response.AddHea der "Content-Disposition", "attachment ; filename=" & fn
Set adoStream = CreateObject("A DODB.Stream")
chunk = 2048
adoStream.Open( )
adoStream.Type = 1
adoStream.LoadF romFile(FPath)
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
adoStream.Close
Set adoStream = Nothing
Response.End
%>
the other contains the data files (\\Server2).
I'm having some problem with the following "file download" code at line
"adoStream.Load FromFile(FPath) ".
The error is "ADODB.Stre am error '800a0bba' / File could not be opened."
Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTi meout = 30000
Response.Conten tType = "applicatio n/x-unknown" ' arbitrary
fn = "MyPhoto.jp g"
fpath = "\\Server2\g$\f iles\MyPhoto.jp g"
Response.AddHea der "Content-Disposition", "attachment ; filename=" & fn
Set adoStream = CreateObject("A DODB.Stream")
chunk = 2048
adoStream.Open( )
adoStream.Type = 1
adoStream.LoadF romFile(FPath)
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
adoStream.Close
Set adoStream = Nothing
Response.End
%>
Comment