[Zope] help with detecting mime_type

Andreas Jung lists at zopyx.com
Thu May 24 06:36:41 EDT 2007



--On 24. Mai 2007 11:31:17 +0100 Alan <alanwilter at gmail.com> wrote:

> Dears,
>
> In my external method I can get mime_type =
> file.headers.headers[1].split()[1] and then my code proceed based on
> which mime type was identified for the file uploaded.
>
> What happens now is that a user uploading a tgz file from a Windows
> platform and then my code did not identify it as a
> application/x-gzip-compressed or similar (it gets
> application/octet-stream).
>
> As far as I understood from this case, such mime type info is passed
> by user's system (where Windows usually is not aware of tar.gz, tgz
> etc format) rather than being set by zope server.

AFAIK..all Zope types derived from OFS.File or OFS.Image are using
OFS.contenttypes.guess_content_types()...if the 'content-type' header
isn't available. Otherwise Zope will use it.


-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070524/1c4952bb/attachment.bin


More information about the Zope mailing list