"ADODB.Stream error '800a0c93' - Operation is not allowed in this context"
Below is my ASP server-side VBScript.
Any help would be greatly appreciated!
Roger Johnson,
Cerious Software, Inc.
SCRIPT:
<%
Dim srcfile, myfile, extn, imgdata
Response.Buffer = TRUE
Response.Flush
srcfile = request.querystring("FILE")
set filesys = CreateObject("Scripting.FileSystemObject")
set myfile = Server.CreateObject("ADODB.Stream")
if (not srcfile="") and filesys.FileExists(srcfile) then
'''' srcfile = "file://" & Left(srcfile,1) & "." & Right(srcfile,
Len(srcfile)-2)
myfile.Open ''''
(srcfile,adModeShareDenyNone,adOpenStreamAsync,"roger","seeking")
myfile.LoadFromFile srcfile
imgdata = myfile.Read(adReadAll)
myfile.Close
extn = filesys.GetExtensionName(srcfile)
Response.Write("<META HTTP-EQUIV='Content-Type' CONTENT='image/" &
extn & "'>")
Response.Write("<META HTTP-EQUIV='Content-Length' CONTENT='" &
CStr(myfile.size) & "'>")
Response.BinaryWrite imgdata
else
Response.Write("<HTML>")
Response.Write("<HEAD>")
Response.Write("<META HTTP-EQUIV='Content-Type'
CONTENT='text/html'>")
Response.Write("</HEAD>")
Response.Write("<BODY>")
Response.Write("Image not available")
Response.Write("</BODY>")
Response.Write("</HTML>")
end if
Response.End
%>
It would be a lot easier for you to work out the details from a standalone script with hardcoded
file paths. Once you get the basic "plumbing" code working you can then plonk it into the ASP page
and deal with the ASP access issues.
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
"Roger Johnson" <rjoh...@cerious.com> wrote in message news:e0Z6D4LgAHA.1612@tkmsftngp03...
Regards,
Roger Johnson
Cerious Software, Inc.
"Michael Harris" <Please....@To.NewsGroup> wrote in message
news:eb06EgYgAHA.1228@tkmsftngp04...