AW: [Zope] No id with manage_addFile()

Peter Sabaini sabaini@inode.at
Fri, 26 Apr 2002 16:48:40 +0200 (CEST)


oh now i get it

yes, manage_addFile() should (with the cookId() method) generate it if=20
its not set

hm, i suggest you take a look at lib/python/OFS/Image.py and try to=20
debug this by adding some print statements.

sorry for not being more specific...

peter. =20


On Fri, 26 Apr 2002, Roger Ineichen wrote:

> I'm not sure, but the id should in the python method manage_addFile()
> set with the filename if nothing is given. ??? Is it not this way?
>=20
> Thanks
> Roger Ineichen
> ___________________________
> END OF MESSAGE=20
>=20
> well i guess its empty because you dont set it :-)
> maybe you should add an entry field=20
>=20
> <input name=3D"id" />
>=20
> or something like that?
>=20
> cheers,
> peter.
>=20
> On Fri, 26 Apr 2002, Roger Ineichen wrote:
>=20
> > Knows sombody why the id is '' (empty) and the funktion not work?
> >=20
> > I send a file with a form:
> > -----------------------------
> > <form action=3D"addFile" method=3D"post" enctype=3D"multipart/form-da=
ta">=20
> > <input type=3D"file" name=3D"file"> <input type=3D"submit" value=3D"u=
pload">
> > </form>
> >=20
> > To the python method:
> > ---------------------
> > def addFile(self,file):
> >   "This method adds a file"
> >   # create the file
> >   self.manage_addProduct['OFSP'].manage_addFile(id=3D'', title=3D'',
> > file=3Dfile)
> >=20
> >   # redirect to main page
> >   return self.REQUEST.RESPONSE.redirect(index_html,=20
> > url_quote(message)))
> >=20
> >=20
> > The error is:
> > -------------
> > The id "" contains characters illegal in URLs.
> >=20
> >=20
> > Mit freundlichen Gr=FCssen
> > Roger Ineichen
> > ___________________________
> >=20
> > Projekt01 GmbH
> > www.projekt01.ch
> > Langackerstrasse 8
> > 6330 Cham
> > phone  +41 (0)41 781 01 78
> > mobile +41 (0)79 340 52 32
> > fax    +41 (0)41 781 00 78
> > email  r.ineichen@projekt01.ch
> > ___________________________
> > END OF MESSAGE
> >=20
> >=20
> >=20
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org=20
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >=20
>=20
>=20
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20