D
David R.
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.LoadFromFile(FPath)".
The error is "ADODB.Stream error '800a0bba' / File could not be opened."
Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTimeout = 30000
Response.ContentType = "application/x-unknown" ' arbitrary
fn = "MyPhoto.jpg"
fpath = "\\Server2\g$\files\MyPhoto.jpg"
Response.AddHeader "Content-Disposition", "attachment; filename=" & fn
Set adoStream = CreateObject("ADODB.Stream")
chunk = 2048
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(FPath)
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
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.LoadFromFile(FPath)".
The error is "ADODB.Stream error '800a0bba' / File could not be opened."
Could someone please offer some suggestions?
<%
Response.Buffer = False
Server.ScriptTimeout = 30000
Response.ContentType = "application/x-unknown" ' arbitrary
fn = "MyPhoto.jpg"
fpath = "\\Server2\g$\files\MyPhoto.jpg"
Response.AddHeader "Content-Disposition", "attachment; filename=" & fn
Set adoStream = CreateObject("ADODB.Stream")
chunk = 2048
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(FPath)
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
adoStream.Close
Set adoStream = Nothing
Response.End
%>