17 Jan
2004
17 Jan
'04
11:17 p.m.
garry saddington wrote at 2004-1-17 10:38 +0000:
I have a form which uploads an xml file into zope. Is it possible to display the contents of this file in a dtml method which is the target of the upload form action.
You get the uploaded file as a "ZPublisher.HTTPRequest.FileUpload" instance (see the source in "ZPublisher/HTTPRequest.py" for documentation). Such objects have a "read" method (which returns the file content as a string). With this method, you can display the file in a DTML method. However, I doubt that you want only to display the content. I expect (as Andreas already suggested) that you want to store the file in Zope and (then maybe) present the content. Follow Andreas' advice in this case... -- Dieter