Load image from db (ASP)

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

ddaaddoo

Load image from db (ASP)

Post by ddaaddoo »

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!
User avatar
xnview
Author of XnView
Posts: 44355
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Load image from db (ASP)

Post by xnview »

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!
You want to use it in ASP page?
Pierre.
kikkoma
Posts: 1
Joined: Mon May 17, 2004 7:14 am

Re: Load image from db (ASP)

Post by kikkoma »

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!
try this

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
I think it will be work!
Jerm

This doesn't work

Post by Jerm »

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,

Code: Select all

img.ReceiveBinary rX
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) :

Code: Select all

img.ReceiveBinary cstr(rX)
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
User avatar
rozi
Posts: 3
Joined: Sat Feb 05, 2005 1:34 pm
Location: Slovenia

Post by rozi »

Try using

Code: Select all

rs("image").Value
instead of

Code: Select all

rs("image")
and see if it helps.