[Zope] Replace files in a specific directory using pythonscript

Ria Marinussen marinus@cs.utwente.nl
Thu, 7 Nov 2002 09:35:33 +0100


Hi all,

On my zope-site I have a special directory which contains only
PDF-documents.
Some of these files need regular updating, for example changed timetables,
or changed regulations.

I don't want the editor to use the management interface of zope, so I need a
custom form and python script to upload and sometimes replace file in this
directory.
What I've got this far is a script (from ZopeLabs.com) and form to upload
new PDF-documents.

I know it is possible to upload a new file replacing the file for a certain
ID because in  the zope management interface this is done by editing the
FileObject with the specified ID. 
I read in the bugcollector that the method "updata_data" cannot be used,
instead "manage_upload" should be used.

I want to create a form in which it is possible to select (radio button) the
PDF-file that should be updated, and browse to a file on the local file
system and upload this file to the specified ID, selected with the radio
button.

Can anyone provide me with a sample python script that uses (or clues how to
use) manage_upload to upload this file to the correct ID?

Thanks in advance,

Ria Marinussen
Webmaster Computer Science
University of Twente