[Zope-CMF] Re: Fwd: [CMF] 281/ 1 Request "FSFile content_type weakness"

Jens Vagelpohl jens at dataflake.org
Sun Sep 5 14:48:08 EDT 2004


On Sep 5, 2004, at 20:40, Tres Seaver wrote:

> Jens Vagelpohl wrote:
>>> Uploaded:  "FSFile.pat"
>>>  - http://zope.org/Collectors/CMF/281/FSFile.pat/view
>>> The way the content_type is detected in CMFCore.FSFile prevents 
>>> content_type to be explicitly specified inside a .metadata file for 
>>> the resource since any content_type value coming from the .metadata 
>>> file is disregarded. This small patch will, as a last resort, use a 
>>> content_type specification from the .metadata file *if* it is 
>>> obvious that the normal content_type detection has failed, meaning 
>>> it returned "application/octet-stream".
>>>
>>> Specific use case for this change: I am trying to store a 
>>> favicon.ico file on the file system. Without the patch it will 
>>> always have "application/octet-stream" and that makes some browsers 
>>> unhappy.
>> Any objections to me merging this patch:
>
> Actually, I think you could make a case for having 'content_type' in 
> the  '.metadata' file *override* any guessed values.  Other than that, 
> +1 on the change.

Giving a content_type declaration inside the .metadata file highest 
priority is even better and will make the patch simpler. If there are 
no objections I'll make that change tomorrow then.

jens



More information about the Zope-CMF mailing list