[Zope] uploading files

Dieter Maurer dieter@handshake.de
Tue, 18 Feb 2003 22:59:13 +0100


Nicolas LAURANCE wrote at 2003-2-18 10:48 +0100:
 > ... uploading file does not set content_type ...
 > My problem is, the content type is not set, it stays empty
 > I would like it to recognize, say application/msword or pdf or rtf or
 > excel files for example
 > 
 > I don't understand, because when I upload a file directly through ZMI
 > the content type is correctly set.

I do not know why it does not work automatically.

However, the "ZMI" uses the "id" as an additional source to
guess the content type. Check the source in "OFS/Image.py",
to learn how it works (and why it does not in your case).

If you know the content type, you can pass it directly to "addFile".


Dieter