[Zope] Help!
Oleg Broytmann
Oleg Broytmann <phd@phd.pp.ru>
Fri, 10 Aug 2001 13:28:24 +0400 (MSD)
On Fri, 10 Aug 2001, Roman V. Isaev wrote:
> Sorry if it's FAQ, but I can't find answer neither on google nor on zope.org.
Tried Russian-speaking Python and Zope mailing list? :)
> How to check file existance?!
It is not file, it is object, but anyway...
> I want to upload file, but I don't know if it exists. So:
>
> <dtml-call "PARENTS[0].manage_delObjects('filename')">
> <dtml-call "PARENTS[0].manage_addFile('filename',file,title=REQUEST['title'])">
>
> If I omit manage_delObjects, file will be uploaded once, then zope barks. If
> I place manage_delObjects, the file HAVE to exist before I upload. Now how
> to write this code in a such way that it would handle uploads in any case?
<dtml-if "'filename' in PARENTS[0].objectIds()">
Oleg.
----
Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.