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

Tres Seaver tseaver@palladion.com
Mon, 16 Jul 2001 11:11:31 -0400 (EDT)


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.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org