[Zope] How to get a name of uploaded file

2001-01-31 Thread Radek Hnilica

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

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] How to get a name of uploaded file

2001-01-31 Thread Fred Yankowski

On Wed, Jan 31, 2001 at 08:26:38PM +0100, Radek Hnilica wrote:
 Is there any way how to get a name of uploaded file.  I mean another than let user 
type the name in another field.

There's a nice example of code for uploading external files in
http://classic.zope.org/pipermail/zope/1999-July/006591.html

-- 
Fred Yankowski   [EMAIL PROTECTED]  tel: +1.630.879.1312
Principal Consultant www.OntoSys.com   fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )