[Zope] Reading uploaded file headers

Greg Green gregory.p.green@boeing.com
Thu, 19 Apr 2001 14:31:48 -0700 (PDT)


I am trying to read the header of a file uploaded in a REQUEST. I can
get the filename and the data, but reading the headers gets me an
authorization failure.

Here is the python script:

if file.headers.has_key('content-type'):
  type = file.headers.get('content-type')
else:
  type = 'text/plain'
return [file.filename, type, file.read()]

If I remove the first 4 lines, everything works fine. Leave them and
I the script doesn't work.

Please reply to me off of the list as well, as I am not subscribed. 

Thanks.

-- 

Greg Green
Advanced Design Systems
Math & Computing Technology
Boeing
(425) 865-2790