Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB
Reading Oracle BLOBS from Zope
 

Index | Next | Previous | View Flat


kenglund at sbc

Sep 7, 2007, 12:08 PM


Views: 1713
Permalink
Reading Oracle BLOBS from Zope

I want to read an Oracle BLOB and display it. I have seen several
examples on the internet, but none of them seem to work.

I am on the following platform:

Zope Version (Zope 2.6.1 (source release, python 2.1, linux2), python
2.1.3, linux2) Python Version 2.1.3 (#1, Sep 19 2002, 21:42:04) [GCC
2.96 20000731 (Red Hat Linux 7.3 2.96-110)] System Platform linux2

I am trying to read a BLOB from an Oracle database. I have noticed
that when I test the ZSQL, I get the following error:



The SQL:

select wgtphot_photo as photo from kenglund.wgtphot where wgtphot_pidm
= 252853

This seems to be returning the image ok. I had to set the max results
to one to get it to work.

The Python:

result = []
lob = ['image']
for row in context.sqllogo:
lob = row['photo']
# result.append({'image': lob.read()})
# above was remmed
container.REQUEST.RESPONSE.setHeader('content-type', 'image/jpeg') return lob

The Web page:

<td><img src="logo;" alt="foto"></td>

Can you give me some ideas as to what I am doing wrong, or if it is
even possible to do what I am trying? I know we are on an old version
of Zope and Python. I inherited this system from someone no longer
working here, and upgrading is on my to-do list.

Thanks so very much!

Ken Englund
Sweet Briar College
Sweet Briar, Virginia
United States


_______________________________________________
Zope-DB mailing list
Zope-DB[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db

Subject User Time
Reading Oracle BLOBS from Zope kenglund at sbc Sep 7, 2007, 12:08 PM
    Re: Reading Oracle BLOBS from Zope lists at zopyx Sep 7, 2007, 11:15 PM
    Re: Reading Oracle BLOBS from Zope charlie at egenix Sep 8, 2007, 2:03 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.