How to get a name of uploaded file
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>
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 fred@OntoSys.com tel: +1.630.879.1312 Principal Consultant www.OntoSys.com fax: +1.630.879.1370 OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA
There's a nice example of code for uploading external files in <http://classic.zope.org/pipermail/zope/1999-July/006591.html>
Much thanks for url, but it seems that zope.org is unaccessible for me at this time. both classic.zope.org and zope.org say me: Netscape's network connection was refused by the server zope.org The server may not be accepting connections or may be busy. Its about one hour I lost access. I can ping, but cannot use web. ... Hey I try access to given url and have that document. But still can't access www.zope.org. I'm going to carefully read what you point me. -- Radek Hnilica <Radek_Hnilica at LinuxFan dot COM>
Or the DTML classic if you care to use that. <dtml-var "_.getattr(file,'filename')">
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 fred@OntoSys.com 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 - Zope@zope.org 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 )
participants (3)
-
Fred Yankowski -
peter bengtson -
Radek Hnilica