[Zope] Checking files to upload

robert robert@redcor.ch
Sat, 05 Oct 2002 17:41:50 +0200


you can ask for its size by

fileToUpload.getsize()
mabe you have to do a fileToUpload.seek(0)
beforehand.

Robert



Juan Manuel Ruiz Garcia wrote:

>Hi,
>
>I want to check selected files for upload before.  My script is this one:
>
>-------------------
>id=context.REQUEST.form['id']
>descr=context.REQUEST.form['desc']
>fileToUpload=context.REQUEST.form['file']
>context.manage_addFile(id,fileToUpload,descr)
>-------------------
>
>The point is that, if I enter a non-existing file in the "file" input field
>in the form that calls this script, this code creates a zero-bytes files,
>instead of warning me... how can I change this code to detect "file not
>found error"?
>
>Working with Zope 2.3 (Python 1.5)
>
>Thanks,
>
>
>
>_______________________________________________________________
>Copa del Mundo de la FIFA 2002
>El único lugar de Internet con vídeos de los 64 partidos. 
>¡Apúntante ya! en http://fifaworldcup.yahoo.com/fc/es/
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>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 )
>
>
>  
>