[Zope] picture as parameter for an external method

Tino Wildenhain tino at wildenhain.de
Mon Oct 11 08:33:59 EDT 2004


Hi,

On Mon, 2004-10-11 at 13:52, VIGNAUX Philippe wrote:
> Thanks for your help Tino,
> 
> 
> 1) For clarity purpose here is the whole page template
> 
> 
> <html>
> <head>
> <title> Titre </title>
> </head>
> <body>
> <form action="py_test" enctype='multipart/form-data' method='post'>
> <input type="file" name="filename">
> <br><br>
> <input type="submit" name="toto">
> </form>
> </body>
> </html>
> 
> 
> 2) here is the python script "py_test"
> 
> request=context.REQUEST
> context.my_external_function( original_id=request['filename'] )
> #context.my_external_function( original_id=request.form.get('filename') )
> #context.my_external_function( request['filename'] )
> 
> !!nb: the 2 commented lines do not change anything to the error message
> ...

Ok, while "filename" is a bit misleading here. In fact you get a file
object. This has an attribute "filename" iirc.
It has the method read() to get data out of it. Maybe you try
another name for the file object just for test and
use request.form explicitely.

Regards
Tino



More information about the Zope mailing list