How can I load image from database or from ASP file (like from example2.asp which came in SKD)
I have tried GetBlob and ReceiveBinary, but I am not sure how that methods work!
Load image from db (ASP)
Moderators: XnTriq, helmut, xnview
-
- Author of XnView
- Posts: 44355
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Load image from db (ASP)
You want to use it in ASP page?ddaaddoo wrote:How can I load image from database or from ASP file (like from example2.asp which came in SKD)
I have tried GetBlob and ReceiveBinary, but I am not sure how that methods work!
Pierre.
-
- Posts: 1
- Joined: Mon May 17, 2004 7:14 am
Re: Load image from db (ASP)
try thisddaaddoo wrote:How can I load image from database or from ASP file (like from example2.asp which came in SKD)
I have tried GetBlob and ReceiveBinary, but I am not sure how that methods work!
Code: Select all
set img=Server.CreateObject("GflAx.GflAx")
sql = "select top 1 * from database"
Set rs = nconn.Execute(sql)
rX=rs("image")
rs.Close
img.ReceiveBinary(rX)
response.binarywrite img.SendBinary
This doesn't work
Your code sample wouldn't work if it could; you can't use parenthesis when calling a sub in asp when using vbscript, so they say.
When I do, in this case though, I get a different error message:
GflAx.GflAx.1 error '80004005'
Unknown format
without the parenthesis,
it doesn't work either. I get this error:
GflAx.GflAx.1 error '80004005'
Bad parameters : 16396
if I change the code to this (as I saw in another post) :
i get this error:
GflAx.GflAx.1 error '80004005'
Bad parameters : 8
If I use getblob (as I saw in another post) it gives the same error messages, I assume this is calling the same function internally.
My data is a gif blob from a sql database. other components can read it properly, and if I send it out to the browser (with contenttype and binarywrite) it looks like an image.
any thoughts or ideas?
Jeremy
When I do, in this case though, I get a different error message:
GflAx.GflAx.1 error '80004005'
Unknown format
without the parenthesis,
Code: Select all
img.ReceiveBinary rX
GflAx.GflAx.1 error '80004005'
Bad parameters : 16396
if I change the code to this (as I saw in another post) :
Code: Select all
img.ReceiveBinary cstr(rX)
GflAx.GflAx.1 error '80004005'
Bad parameters : 8
If I use getblob (as I saw in another post) it gives the same error messages, I assume this is calling the same function internally.
My data is a gif blob from a sql database. other components can read it properly, and if I send it out to the browser (with contenttype and binarywrite) it looks like an image.
any thoughts or ideas?
Jeremy
-
- Posts: 3
- Joined: Sat Feb 05, 2005 1:34 pm
- Location: Slovenia
Try using instead of and see if it helps.
Code: Select all
rs("image").Value
Code: Select all
rs("image")