[Zope-dev] Re: inconsistent mimetype assignment for uploaded files
Tino Wildenhain
tino at wildenhain.de
Tue Oct 5 06:44:32 EDT 2004
Hi,
On Tue, 2004-10-05 at 12:11, Dominic Hiles wrote:
> Dear Tres,
>
> --On 04 October 2004 13:43 -0400 Tres Seaver <tseaver at zope.com> wrote:
>
> > Dominic Hiles wrote:
> >
> >> Sorry, I missed these susbequent follow-ups before posting a reply a few
> >> minutes ago! If we're going down this route, can we at least change
> >> things so that the "guessing" is done using
> >> ZServer.medusa.mime_type_table, rather than the default python mimetypes
> >> table?
> >
> > I would guess that the medusa version is more neglected than the Python
> > one; is your experience otherwise?
> >
>
> I now realise where my confusion came from. Python 2.1.3 had only 85 file
> extensions listed in mimetypes.types_map.keys() whereas
> ZServer.medus.mime_types_table showed 106 with Zope 2.6.4. However, Python
> 2.3.3 is now up to 117, so I guess it makes the better choice. Apologies
> for the noise....that said, I'm still unhappy that a browser can dictate
> the mimetype chosen for an uploaded file, but I'm happy enough to fix that
> at the application level.
Well, the problem might be the asymptation part of the filename
should be considered an indicator of its contents.
Arent there any libs for python to examine the contents (usually
the first few bytes) for the type of the file?
Regards
Tino
More information about the Zope-Dev
mailing list