click here for a demo
The important part is the encoding type "multipart/form-data" and the input type of the form "file". The following CGI script will process the request and put the file in the same directory of the upload.cgi script: