[Zope-dev] How to get the FULL path of an uploaded file?

Craeg K. Strong zope-dev@zope.org
Thu, 18 Oct 2001 14:37:47 -0400


Does anyone know offhand how to get the FULL path of an uploaded file?

I am using the standard HTML <input type="file"> within a form inside a 
DTML document.

Inside my python method, I am getting a 
ZPublisher.HTTPRequest.FileUpload object.   Fine.

This stuff wraps the standard python cgi module to give you access to 
the headers and contents of the
file.  You can use a FileUpload the same way you would use a file.

The problem is:  the name of the FileUpload is the leaf name of the 
file, but not the entire path.

Does anyone know how to get the FULL PATHNAME as listed in the input 
field in the HTML form?

I believe Python is being too clever by half and by the time I get my 
grubby hands on it, the value is gone.

The only thing I could come up with was an awful little JavaScript hack 
where I snag the value from the
input field into another "hidden" field using OnChange/OnClick/OnBlur, 
and grab it later.

Any suggestions would be greatly appreciated.  Thanks!

(Should I repost this question on a python-dev list? hmmmmm)

--Craeg