[Zope] File uploader

Todd Loomis tloomis@dmso.mil
Fri, 17 Aug 2001 12:03:42 -0400


I keep getting this error after trying this code:

Error Type: NameError
Error Value: manage_upload


At 08:50 AM 8/17/2001 -0700, you wrote:
>Hi Todd,
>Do you want to store your files on the local file system or in Zope as File
>objects?
>Either way, have a look at how the 'Add File' form works in Zope.  That'll
>show you how to get the file up to Zope.  From there you will need to move
>it to the folder you want.
>I upload to a LocalFS object ('data').
>Here's the form used to collect the file name:
>---------------------------------
><dtml-var standard_html_header>
><H2><dtml-var document_title></H2>
>  Select the file you want to upload from your local drive by clicking the
>  "Browse" button.<br>
>Then, click the "Upload" button.<br>
>
><FORM ACTION="AddFile" METHOD="POST" ENCTYPE="multipart/form-data">
><TABLE CELLSPACING="2">
><TR>
>   <TD ALIGN="LEFT" VALIGN="TOP">
>   <STRONG>File Name</STRONG>
>   </TD>
>   <TD ALIGN="LEFT" VALIGN="TOP">
>   <input type="text" name="FileName" size="40">
>   </TD>
></TR>
><TR>
>   <TD ALIGN="LEFT" VALIGN="TOP">
>   <STRONG>File</STRONG>
>   </TD>
>   <TD ALIGN="LEFT" VALIGN="TOP">
>   <INPUT TYPE="file" NAME="file" SIZE="25" VALUE="">
>   </TD>
></TR>
><TR>
><TD></TD>
><TD>
><BR><INPUT TYPE="SUBMIT" VALUE=" Upload ">
></TD>
></TR>
></TABLE>
></FORM>
><dtml-var standard_html_footer>
>---------------------------------
>
>Here's my 'AddFile' DTML Method:
>---------------------------------
><dtml-with "data">
>     <dtml-call expr="manage_upload(id=REQUEST['FileName'], file=file)">
></dtml-with>
><dtml-call "RESPONSE.redirect('./FileList')">
>---------------------------------
>You will need to modify the AddFile method a bit to specify the folder in
>which you want to store the file.
>
>Hope that helps.
>
>Eric.
>
>
>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Todd
>Loomis
>Sent: Friday, August 17, 2001 8:13 AM
>To: zope@zope.org
>Subject: [Zope] File uploader
>
>
>All:
>
>I need to make a file uploader which can upload to a specific
>folder(selected by the user in the form) and set permissions. Can anybody
>help I''m having major problems!
>
>Thanks,
>Todd
>
>
>_______________________________________________
>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 )


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Todd Loomis
Web Developer (SAIC)
Defense Modeling & Simulation Office
1901 N. Beauregard Street, Suite 500
Alexandria, VA 22311
Office: 703.824.3407 Fax: 703.379.3778
tloomis@dmso.mil