[Zope] Zope, MySQL and pictures in blob-fields ...
el-nino@gmx.li
el-nino@gmx.li
Thu, 26 Sep 2002 15:34:26 +0200 (MEST)
Hello to everybody!
I'd like to provide users with a possibility to upload pictures into a
MySQL-Database. Therefore I created a web-form (using method="post" and
enctype="multipart/form-data") with an input for uploading files (<input type="file"
name="VorschlagBild">).
The action of the form calls a SQL-Method that stores the data received from
the into a MySQL-table (insert into Vorschlag values([...]<dtml-sqlvar
VorschlagBild type="string">)). The picture should be put into a blob-field. I
used 'type="string"' because "file" or something similar does not exist.
Finally, the record gets stored into the MySQL-database, but the picture
isn't saved the way I expected. Taking a look at the content of the table using
webmin, the appropriate field just shows "<ZPublisher.HTTPRequest.FileUpload
instance at 0x893a7ec>".
Can anybody tell he how I manage to save/upload the picture and possibly
even show it again in a website afterwards?
Thanks in advance, and sorry if it is a simple question ... I tried to find
a solution but couldn't find one.
SInce I am unsure if this one should be posted to the RDBMS-list, I started
here ... if this was wrong: Sorry!
Thilo
--
Werden Sie mit uns zum "OnlineStar 2002"! Jetzt GMX wählen -
und tolle Preise absahnen! http://www.onlinestar.de