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. I have searched all over for an answer and have come up empty. I know this may be simple to some people but at the moment this is blocking my further progress with zope. If there is any documentation on this subject could someone point me at it please? regards garry
If you upload a file you can store it using a PythonScript as 'File' object in Zope. This is often described and documented (search on zope.org). Then redirect from the PythonScript to a DTML Method that renders a form with the content of the File object as part of a textarea.....I think both steps are straightforward and documented and solvable if you have a little knowledge in Zope. -aj --On Samstag, 17. Januar 2004 10:38 Uhr +0000 garry saddington <garry@joydiv.fsnet.co.uk> wrote:
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. I have searched all over for an answer and have come up empty. I know this may be simple to some people but at the moment this is blocking my further progress with zope. If there is any documentation on this subject could someone point me at it please? regards garry
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
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
participants (3)
-
Andreas Jung -
Dieter Maurer -
garry saddington