[Zope-CMF] ?how to override default content-type when putting files with FTP

Tim Hoffman timhoffman@cams.wa.gov.au
Tue, 17 Jul 2001 15:30:13 +0800


Ahh I am blind

Since your reply I discovered the content_type_registry tool which provides
a very nice and easy mechanism. Damn I gotta rtfm better I suppose.

Tim

Tres Seaver wrote:

>On Mon, 16 Jul 2001, Tim Hoffman wrote:
>
>>I am building a CMF site, with a number of customized (ZClass
>>based for the moment) Portal content types.
>>
>>I will need to bulk upload images (which have a new Portal type
>>based on CMFOptions ExtImage) which I am calling ArtWorkMedia,
>>the parent Folder is ArtWorkFolder.  ArtWorkFolder is defined
>>to only allows content-types of ArtWorkMedia and
>>ArtWorkMediaThumbnail, however when I upload images into an
>>ArtWorkFolder they are uploaded as Portal Image, which is
>>pretty much what I expected (though I half expected an error).
>>
>>Obviously I have to override the default behaviour/portal_type
>>for the images uploaded by ftp/webdav but I am having trouble
>>working out how/where I can/should do this.
>>
>>Could someone give me a pointer.
>>
>
>You can customize the PUT handling of a folder by adding a
>ContentTypeRegistry object to it, and then configuring it to
>convert PUTs with Content-type='image/*' to your ArtWorkMedia
>class.
>
>Tres.
>