[Zope] Zope, MySQL and pictures in blob-fields ...

Kevin Carlson khcarlso@bellsouth.net
Fri, 27 Sep 2002 10:08:33 -0400


You'll have to use a python script or pass the arguments directly to the
ZSQL query.  In your ZSQL query it seems you have arguments named
VorschlagBez, ProjektNr, and VorschlagBild.  You will need to add another
argument or change an exisitng argument to represent the file data, for
example, VorschlagBildData.

When you call insertVorschlag you can do it like this:

<dtml-call "insertVorschlag(VorschalgBez=VorschlagBez, ProjektNr=ProjektNr,
VorschlagBildData=VorschlagBild.data)">

The above should work fine, but I highly recommend using python scripts to
handle form submissions as doing things such as data validation and
manipulation is much more clear IMHO than in DTML.

Hope this helps,

Kevin

-----Original Message-----
From: el-nino@gmx.li [mailto:el-nino@gmx.li]
Sent: Friday, September 27, 2002 2:36 AM
To: Kevin Carlson
Subject: RE: [Zope] Zope, MySQL and pictures in blob-fields ...


> I think you want to use the data attribute of the filename.  For example,
> if
> the input field is named "filename", you should use the contents of
> filename.data as input to your blob column in the database.

Thanks, this sounds good :-)
But to be true, I don't have any idea how to do this ...

In my document, I have the following lines:
<form action="insertVorschlagAction" method="post"
enctype="multipart/form-data">
<input type="file" name="VorschlagBild">
[...]


My "insertVorschlagAction" looks like this:
<dtml-var standard_html_header>
<dtml-call insertVorschlag>
<dtml-var standard_html_footer>


"insertVorschlag" looks like this:
insert into Vorschlag values(
	'',
	<dtml-sqlvar VorschlagBez type="string">,
	<dtml-sqlvar ProjektNr type="string">,
	<dtml-sqlvar VorschlagBild type="string">
)


In the "insertVorschlag"-method, I can not access VorschlagBild.data ...
it's unknown.
Can somebody tell me where I can use this variable and how I can put it into
the database.
I'm sorry that I keep asking this question, but I cannot find a point to
start from ... :-(

Hope somebody will help me and point to the correct direction :-)

Thanks in advance!

Thilo

--
Werden Sie mit uns zum "OnlineStar 2002"! Jetzt GMX wählen -
und tolle Preise absahnen! http://www.onlinestar.de