Getting the filename from a file upload
I'm uploading a file to a LocalFS folder. The upload part is working, but I am trying to return the name of the uploaded file for inclusion into a MySQL database, and am getting a Zope reference string returned rather than the file name. My method is: An HTML form with a file field called 'my_attachment' calls this DTML method: <dtml-call "REQUEST.set('my_attachment',my_attachment)"> <dtml-call "manage_upload(my_attachment, id='',action='manage_workspace')"> Which uploads a file and returns the value: 'ZPublisher.HTTPRequest.FileUpload instance at 0xaa04964' How might I return the filename of the uploaded file rather than, or in addition to, this string? Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
hpinson@indepthl.com wrote at 2003-8-16 13:10 -0600:
... When you have a "FileUpload" instance "file", then "file.filename" gives you its filename.
Note, however, that some versions of IE have a bug and return the full path name while most other browser return only the filename (without directory) (as it should be for security reasons). Dieter
participants (2)
-
Dieter Maurer -
hpinson@indepthl.com