[Zope] How to get a name of uploaded file

Radek Hnilica Radek_Hnilica@LinuxFan.COM
Wed, 31 Jan 2001 20:26:38 +0100 (CET)


	Hello zopists,

I create a small application.  User enters file via web interface, and this is parsed and pushed into SQL.
the input form is DTML method like this
==== DTML method: send_file == I use [] instead of <>
[dtml-var standard_html_header]
...
  [form action="receive_file" method="post" enctype="multipart/form-data"]
    ...
    [input type="File" name="file" value=""]
    ...
    [input type="submit" value=" Send File "]
    ...
  [/form]
[dtml-var standard_html_footer]
====== end of file =====

The receive_file is external python method
===== receive_file, function name= rcv_file
from string import strip
import pg

def rcv_file(self, REQUEST):
    ...
    fileobj = REQUEST.form['file']
    filelist = fileobj.readlines()
    fileobj.close
    for line in filelist:
        (* parse line and push it into SQL server *)
    ...
====== end of file ====

Is there any way how to get a name of uploaded file.  I mean another than let user type the name in another field.
I was looking in REQUEST object and nothing about the filename found there.
I allso read Zope Book, digging in documentation arround, but with no success.

-- 
Radek Hnilica <Radek_Hnilica at LinuxFan dot COM>