Hi I want to read the contents of a file.I have a form where user uploads doc files.I want to give preview of that file after user uploads the file.What I am thinking is I will read the contents of that file and store it in another file with content-type text/html so that it can be displayed in the browser.But I have no idea how to read the contents of a file stored in zodb .Can someone help? __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/
Hi John,
I want to read the contents of a file.I have a form where user uploads doc files.I want to give preview of that file after user uploads the file.What I am thinking is I will read the contents of that file and store it in another file with content-type text/html so that it can be displayed in the browser.But I have no idea how to read the contents of a file stored in zodb .Can someone help? You don't need to start a new thread to ask. Just do a reply to the answers you got and ask what you didn't understand.
Anyway, answering to your question, you could start by modifying this script: http://www.zope.org/Members/mjablonski/howtoPDF It produces a PDF on the fly, but you could do a doc to html document. You just have to do some modifications: * Add a parameter for the url where your word document is. * Instead of calling htmldoc, install wvware (see my previous reply to your message) and call wvHtml. * This method returns a PDF, but doesn't store it on the ZopeDB. So, if you want to store it on the ZopeDB, then you will have to do the following: from OFS.Image import manage_addFile container=self.restrictedTraverse(FolderURL,None) manage_addFile(container,id,title=title,file=data) There are may be more modifications, so, it won't work at first. If you don't get it working, then post your code and we will try to help you. Regards, Josef
participants (2)
-
john blair -
Josef Meile