Sorry if it's FAQ, but I can't find answer neither on google nor on zope.org. How to check file existance?! 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? -- Roman V. Isaev http://www.aroma.ru System Administrator
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.
Roman V. Isaev wrote:
Sorry if it's FAQ, but I can't find answer neither on google nor on zope.org.
How to check file existance?!
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?
I don`t understand exactly what you want to do but maybe <dtml-try> will help you. <dtml-try> <dtml-call "PARENTS[0].manage_delObjects('filename')"> </dtml-try> <dtml-call "PARENTS[0].manage_addFile('filename',file,title=REQUEST['title'])"> Bye, Vincenzo -- Vincenzo Di Somma - Responsabile Ricerca e Sviluppo - Icube S.r.l. Sede: Via Ridolfi 15 - 56124 Pisa (PI), Italia E-mail: e.disomma@icube.it WWW: www.icube.it Tel: (+39) 050 97 02 07 Fax: (+39) 050 31 36 588
participants (3)
-
Oleg Broytmann -
Roman V. Isaev -
Vincenzo Di Somma