[Zope] How do I ask Zope for the name of an uploaded file?

Cameron Laird claird at lairds.com
Sun Aug 24 18:44:34 EDT 2003


I'll abbreviate this:  in a Python script that processes a
file upload, how do I express the name of the uploaded file--
that is, the name of the file the user selected with his 
browser?  I expected I'd find this in something like
  context.REQUEST.get_header('CONTENT-DISPOSITION')
or
  context.REQUEST.get_header('filename')
or somesuch, but I'm just getting None from those.

Note that this information is available only through the 
HTTP dialogue; as near as I can tell, it is NOT available
through the context.REQUEST dictionary.

I anticipate a couple of possibilities.  One is that some-
one will know immediately what I'm trying to say, and will
give me the one-line answer I'm after.

The second is that my description puzzles everyone.  In 
that case, I'll happily detail a model that should make all
this clear.  I prefer to avoid the work, though, if it's un-
necessary.



More information about the Zope mailing list