[Zope] python modules problem

Dieter Maurer dieter@handshake.de
Mon, 29 Apr 2002 22:00:28 +0200


Cedric Bellegarde writes:
 > <FORM ACTION="AliacomPresse_add" METHOD="post"> 
 >     <INPUT TYPE="file" NAME="img">
 > </FORM>
You should use 'enctype="multipart/form-data"' as an additional
"form" attribute. 

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

can tell you why ("Web publishing section").


 > when i access img in AlicomPresse_add(python script),he hasn't the value 
 > '/home/cedric/my_img.png' but the value 'my_img.png'.It makes that with 
 > mozilla and galeon but at home on my computer it works 
 > perfectly.Configuration problem????
Not sure, I understand your problem:

  It is fine that "img.filename" is "my_img.png" and not
  (as in IE) "/home/cedric/my_img.png" as the latter reveals
  both unnecessary and potentially sensitive information
  to the server.

If you mean:

  The "img" variable gets bound to the string "my_img.png"
  rather than the file uploaded from "/home/...", then
  the missing "enctype" attribute is the cause.


Dieter