[Zope] Help!

Vincenzo Di Somma e.disomma@icube.it
Fri, 10 Aug 2001 11:44:27 +0200


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