[Zope] Problems with mime types

Juho Vuori juho.vuori at kepa.fi
Fri Dec 5 03:45:27 EST 2003


Hello. I ended up working with zope version 2.6.3 without knowing much 
about it. One of the services it is running is a message board that 
allows file attatchments in the messages. It works fine most of the 
time, but say open office .sxw files end up being octet streams and 
become difficult for users to open and they complain. I've been peeking 
around zope and found some references to mime types and tried adding the 
mime types somewhere as well, but my modifications don't seem to have 
any effect. That's propably because I didn't know at all what I was 
doing and where zope mime types are stored in the first place. Any ideas?

Our messageboard attachments work briefly like this: The message is read 
in from a form:

  <form method="post" action="<dtml-var URL0>" 
enctype="multipart/form-data">
...
  <input type="file" name="attached_file"><br><br>
...
  </form>

Values from the form are then passed to a python script that gets the 
mime type from file headers(?):

...
  filetype = match('Content-Type: ([\w/]+)', attached_file.headers)
...

Who sets these headers and how to change its behaviour?

Cheers,
  Juho




More information about the Zope mailing list