Zope + PostgreSQL + BLOBS, how?
Is it possible to store, say, staff pictures in PostgreSQL and then show them on a webpage served by Zope? Like: PostgreSQL -> DA -> Zope -> webpage If it is possible; can someone give me a few guidelines or hints on how it is done? I've never worked with BLOBs, but have done lot of standard SQL stuff, also with Zope. -- Best regards / Mvh., Steen Suder, sysadm kollegie6400.dk -|- OpenSource --- Sign of the time Scan-Aqua ADVARSEL WARNING http://www.uk.k64.dk/sfs/Scan-Aqua/
Steen, Is a RDBMS the best place to keep the pictures? Why not just keep the name of them in the RDBMS and keep the actual pictures in the ODB. It seems more logical to me that way at least. Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Steen Suder" <CAB@earthling.net> To: "Zope mailinglist" <zope@zope.org> Sent: Saturday, January 08, 2000 11:30 PM Subject: [Zope] Zope + PostgreSQL + BLOBS, how?
Is it possible to store, say, staff pictures in PostgreSQL and then show them on a webpage served by Zope?
Like: PostgreSQL -> DA -> Zope -> webpage
If it is possible; can someone give me a few guidelines or hints on how it is done?
I've never worked with BLOBs, but have done lot of standard SQL stuff, also with Zope.
-- Best regards / Mvh., Steen Suder, sysadm kollegie6400.dk -|- OpenSource --- Sign of the time
Scan-Aqua ADVARSEL WARNING http://www.uk.k64.dk/sfs/Scan-Aqua/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Phil Harris wrote:
Steen,
Is a RDBMS the best place to keep the pictures?
Maybe not, but reasons why not, has never been of particular interest to geeks, have they? ;-)
Why not just keep the name of them in the RDBMS and keep the actual pictures in the ODB.
I could do that, yes. It'd make it a bit more complicated to use the pictures from other non-Zope apps, though. That's why.
It seems more logical to me that way at least.
In most cases, indeed.
<Cut> Most simple: How do I handle BLOBs in and out of a RDBMS via Zope? -- Best regards / Mvh., Steen Suder, sysadm kollegie6400.dk -|- OpenSource --- Sign of the time Scan-Aqua ADVARSEL WARNING http://www.uk.k64.dk/sfs/Scan-Aqua/
I realize this isn't the answer to your question, but I have a large photo database that I am serving out of zope (1500+ images). I keep the photos indexed by name on the disk and alias the directory with apache. Then I use an external method to hand me back a string of either <IMG SRC='/apache_alias/image_key.jpg'> or a 'No image found' string, depending on the results of the key search. I went this way because from what I understand of postgres, this is much faster than using the large object methods. Plus I can mess with the images directly without having to use postgres to get at them. cheers jim Steen Suder wrote:
Is it possible to store, say, staff pictures in PostgreSQL and then show them on a webpage served by Zope?
Like: PostgreSQL -> DA -> Zope -> webpage
If it is possible; can someone give me a few guidelines or hints on how it is done?
I've never worked with BLOBs, but have done lot of standard SQL stuff, also with Zope.
-- Best regards / Mvh., Steen Suder, sysadm kollegie6400.dk -|- OpenSource --- Sign of the time
JB wrote:
Steen Suder wrote:
Is it possible to store, say, staff pictures in PostgreSQL and then show them on a webpage served by Zope?
Like: PostgreSQL -> DA -> Zope -> webpage
If it is possible; can someone give me a few guidelines or hints on how it is done?
I've never worked with BLOBs, but have done lot of standard SQL stuff, also with Zope.
I realize this isn't the answer to your question, but I have a large photo database that I am serving out of zope (1500+ images). I keep the photos indexed by name on the disk and alias the directory with apache. Then I use an external method to hand me back a string of either <IMG SRC='/apache_alias/image_key.jpg'> or a 'No image found' string, depending on the results of the key search. I went this way because from what I understand of postgres, this is much faster than using the large object methods. Plus I can mess with the images directly without having to use postgres to get at them.
And if one wants to be real creative one could write a PostgreSQL function that saves/retrieves the image from file system. so select saveimage('filename','base64encodedGif') saves the image and select retrievimage('filename') gets it back, either as binary or base64 encoded string, depending on the cursor mode. It should be feasible now that PostgreSQL has no limits on Query length. But of course keeping them in filesüstem seems to make more sense to just keep images in file system. --------------- Hannu
participants (4)
-
Hannu Krosing -
JB -
Phil Harris -
Steen Suder