[Zope] Upload File to a different Folder with python

Roger Ineichen r.ineichen@projekt01.ch
Fri, 26 Apr 2002 13:51:30 +0200


Hello together
How can I add a file with a Python Class/Method. I have to call this
Method from a other folder like:

Python_product_instance
|
|-FileFolder
|  |
|  |-addFile()
|
|-skin
   |
   |--uploadForm action addFile


My uploadForm
------------
<form action="../FileFolder/addFile" method="post"
enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Hochladen">
</form>


My addFile:
------------
def addFile(self,file):
	# create the file
	self.manage_addFile(id, file=file, title="")
		
	self.manage_addProduct['OFSP'].manage_addFile(id='', title='',
file=file)
	# create a success message
	message="File '%s' uploaded successfully." % file.filename

	# redirect to main page - this is necessary to make all the URLs
	# on the main page work correctly.
	return self.REQUEST.RESPONSE.redirect("%s?message=%s" %
(self.absolute_url(), url_quote(message)))


The error is:
-------------
The object at Url---FileFolder/addFile has an empty or missing
docstring. Objects must have a docstring to be published. 


Thanks a lot friends
Roger Ineichen
___________________________

Projekt01 GmbH
www.projekt01.ch
Langackerstrasse 8
6330 Cham
phone  +41 (0)41 781 01 78
mobile +41 (0)79 340 52 32
fax    +41 (0)41 781 00 78
email  r.ineichen@projekt01.ch
___________________________
END OF MESSAGE