Passing a file to server

Bill Wood wwood at ucsd.edu
Mon May 7 15:57:14 CDT 2001


~sdpm~
Joel,

Below is a snippet of html that can be used to upload a file. I use this in 
conjunction with a cgi process to validate the content of a file. When form 
is submitted,  the entire contents of the file is sent to your cgi process 
via the form variable associated with the Submit button. In the snippet 
below that would be 'thefile'. This variable will be a scalar variable from 
which you can do what ever you need process your file. If you simply want 
to save the file, open a file handle and write the scalar variable to the 
file handle.

<FORM
         METHOD='POST' ACTION=' --- place your cgi url here ---'
         ENCTYPE='multipart/form-data
 >
<H3>File Validation</H3>

<TABLE NAME='content' >
<tr>
<td>
<b>Enter the file name (including the path) or press the 'Browse' button to 
search for the file.</b>
</td>
</tr>
</table>
<INPUT TYPE='file' NAME='thefile' SIZE=30 VALUE=''>
<table>
<tr>
<td>
<tr>
<td>
<INPUT TYPE="submit" NAME="event" VALUE="Submit Form">
<INPUT TYPE="reset">
</td>
</tr>
</TD>
</TR>
</TABLE >
</FORM>

Bill Wood
University of California at San Diego
Administrative Computing and Telecommunications - 0929
10280 North Torrey Pines Rd.
La Jolla, Ca 92093-0929
EMail: wwood at ucsd.edu

At 12:03 PM 5/7/2001, Joel Fentin wrote:
>~sdpm~
>I want the user of the website to be able to send a file to the
>server.
>
>It might go something like this:
>
>On the browser page, there is an interface (popup & scrolling
>list?) that permits the user to select a subdirectory and file
>from his own computer. He presses the button, and the file is
>FTPed or otherwise sent to the server.
>
>If someone can point me in the right direction, I might be able
>to fill in the blanks.
>
>
>--
>Joel Fentin    tel: 760-749-8863    FAX: 760-749-8864
>
>email: joel at fentin.com                web: fentin.com
>~sdpm~
>
>The posting address is: san-diego-pm-list at hfb.pm.org
>
>List requests should be sent to: majordomo at hfb.pm.org
>
>If you ever want to remove yourself from this mailing list,
>you can send mail to <majordomo at happyfunball.pm.org> with the following
>command in the body of your email message:
>
>     unsubscribe san-diego-pm-list
>
>If you ever need to get in contact with the owner of the list,
>(if you have trouble unsubscribing, or have questions about the
>list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
>This is the general rule for most mailing lists when you need
>to contact a human.


Bill Wood
University of California at San Diego
Administrative Computing and Telecommunications - 0929
10280 North Torrey Pines Rd.
La Jolla, Ca   92093-0929

EMail:	wwood at ucsd.edu
Phone:	858/534-1291
Fax:	858/534-7656

~sdpm~

The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.




More information about the San-Diego-pm mailing list