[PyGreSQL] Storing images/documents in bytea fields as base64 encoded strings
G. Skerrett
imageguy1206 at gmail.com
Sat Dec 30 11:31:25 EST 2006
We have are developing an internal application to store documents and images
in the postgresql db.
After struggling with escaping the low order characters for including in the
bytea field, we hit upon the idea of simply using the python base64 modules
to encode files as base64 strings and store the string in the database.
We think that the benefit is doing this is;
1) using an industry standard encoding mechanism so they could be decoded
with another application if desired.
2) the images/documents are "web/email ready", so storing and encoding stage
will encur a penalty hit, hwoever, the retreival will not.
If any one on this list has suggestions/comments or can see a problem with
this strategy, we would appreciate comment.
BTW, we have already wrestled with the "store in db vs store in filesystem"
and we think that this is the best way to go.
Thanks in advance.
Geoff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.vex.net/pipermail/pygresql/attachments/20061230/5fcbda96/attachment.html
More information about the PyGreSQL
mailing list