[Zope] can't use new mime type (content_type)

Dieter Maurer dieter@handshake.de
Fri, 20 Jun 2003 20:27:18 +0200

Rob Boyd wrote at 2003-6-18 09:30 -0700:
 > I'm having problems with uploaded files not getting
 > their content_type set to their correct mime type. 
 > Specifically, .jar and .jnlp files.  I added entries
 > to mimetypes.py for them (application/x-jar and
 > application/x-java-jnlp-file) in mimetypes.types_map. 
 > I can now change the content_type property of an
 > existing File object to these new types.  However,
 > when uploading a file, OFS.Image first correctly gets
 > the content_type when init() calls get_content_type,
 > but then manage_upload resets it to
 > application/octet-stream.

"OFS.Image.File.manage_upload" uses "OFS.Image.File._get_content_type"
to determine the content type. Apparently, it does not recognize
your type and uses the default.

You probably need to extend the content type map
interpreted by "guess_content_type".