[Zope] mySQL image addition

Alexander Staubo alex@mop.no
Tue, 6 Jul 1999 02:21:20 +0200


If it's of any help: I've stored images in MS SQL (not MySQL) servers,
and this is somewhat painful, because you need to convert the binary
data into hexadecimal values, thus:

	insert into foo (myimage) values (0x01020304[...])

I don't know MySQL does BLOb inserts. However, I think it's reasonable
that you cannot simply enter a literal string; or? How does Zope handle
it?

(Btw, I wrote a C extension for Python that performs the hex conversion
(because it took literally hours if done in pure Python), and one
problem that bugged me for some time was that SWIG doesn't generate
wrappers that can take strings containing null bytes; the Python API was
transforming my strings into some kind of weird 7-bit-ish format. The
solution was to patch SWIG's wrapper code manually (Jim, do know if SWIG
can be told to do this?) to parse the string argument differently.)

--
Alexander Staubo             http://www.mop.no/~alex/
"What the hell, he thought, you're only young once, and threw
himself out of the window. That would at least keep the element of
surprise on his side."
--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_

>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>Martijn Pieters
>Sent: 6. juli 1999 01:03
>To: Phil Grove; zope@zope.org
>Subject: Re: [Zope] mySQL image addition
>
>
>At 14:59 05/07/99 , Phil Grove wrote:
>>hi all,
>>
>>has anyone used mySQL to hold a number of images uploaded
>using Zope? If so
>>how can it be done, i have tried using the normal INSERT
>statments into a
>>BLOB field in the database but it only seems to insert a
>strange instances
>>string??
>>
>>Any ideas would be appreciated.
>>
>>P.
>
>No experience using images stored in a DB, but the 'strange instances
>string' sounds familiar enough. Can we see your code?
>
>--
>Martijn Pieters, Web Developer
>| Antraciet http://www.antraciet.nl
>| Tel: +31-35-7502100 Fax: +31-35-7502111
>| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
>| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------

_______________________________________________
Zope maillist  -  Zope@zope.org
http://www.zope.org/mailman/listinfo/zope

(For developer-specific issues, use the companion list,
zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )