Page 1 of 1

Load image from db (ASP)

Posted: Sun Apr 25, 2004 10:44 am
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!

Re: Load image from db (ASP)

Posted: Thu Apr 29, 2004 4:41 am
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.

Re: Load image from db (ASP)

Posted: Mon May 17, 2004 7:44 am
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!

This doesn't work

Posted: Fri Dec 31, 2004 5:49 am
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

Posted: Sat Feb 05, 2005 1:39 pm
by rozi
Try using

Code: Select all

rs("image").Value
instead of

Code: Select all

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