On Sat, 2002-02-02 at 02:45, Stefan H. Holek wrote:
At 02.02.2002 02:27 +1300, Adam Warner wrote:
If I can't robustly upload files to a zope database using FTP then I may have to reevaluate this specific use of zope. All I uploaded was some HTML source. If zope can't cope with that then I can't easily use it to archive HTML source material.
It appears that Zope's trying to be too clever. Textual content should be able to be uploaded via FTP. Not rejected because of an overly exuberant DTML parser.
No, it appears you are trying to be too lazy ;-)
Zope will by default create DTML Documents when text files are uploaded. You can however use a PUT_factory to make it create whatever you heart desires.
Thanks guys. I can sleep easier now :-) Here's what was 'wrong' with the HTML document: Document Template Parse Error Unexpected tag, for tag <!--#CONFIG TIMEFMT="%Y" -->, on line 266 of news
An example PUT_factory can be found here: <http://www.zope.org/Members/shh/Patches/PUT_factory.py>
What it basically does is mapping a MIME type to a Zope object type.
OK.
Please also read <http://dev.zope.org/Wikis/DevSite/Proposals/HookablePUTCreation>
"For objects which do not yet exist in a given container, Zope creates a NullResourcex object with the given id, which then handles the 'PUT 'by creating one a "stock" Zope object (a DTMLDocumentx for text-like content, an OFS.Image for image-like content, or an OFS.Image.File for all others)." Well that makes perfect sense. So all I need to do is redefine the default text-like content. Using an External Method. So I just have to figure out how to make the default MIME type text/html.
HTH,
Yes, thanks. Regards, Adam