This document contains information about multipart form submissions to help in writing code to accept job file submissions to a web server.  The application is intended for creating tools to remotely control the RealSystem Producer by uploading jobs which can then be run using a different CGI script.

This document is not an exhaustive description of multipart form-data submissions.  It is intended to provide information on how to easily parse form uploads for text files only.  There are actually examples that one can find for almost every language for handling multipart form uploads that are far more exhaustive than this example.  Please feel free to search on the web for packaged programs that handle form submissions.  Some good ones are:

	PERL  cgi-lib.pl http://cgi-lib.berkeley.edu
	TCL   cgilib     http://expect.nist.gov/cgi.tcl/
	C/C++ eCgiLib    http://global-owl.de/ecgi/

Multipart form data contain 1 or more sections separated by a delimiter.
Something like this:

	-----------------------------11909339125713
	Content-Disposition: form-data; name="jobfile"; filename="C:\files\desktop\InsideXML\CH01PG2.txt"
	Content-Type: text/plain

	Some data
	Some more data

	and yet some more data
	-----------------------------11909339125713--

The characteristics to note are:

* A Content-Disposition header starts each section and provides information about the content
* A Content-Type information gives yet more information if the input is a file upload

The "-----------------------------11909339125713" is the boundary value.  This is
defined in the boundary= variable in the CONTENT_TYPE environment variable.

The very last boundary is appended with a "--".

If a form has more than one element, then multple sections exists as shown below:

	-----------------------------11909339125713
	Content-Disposition: form-data; name="jobfile"; filename="C:\files\desktop\InsideXML\CH01PG2.txt"
	Content-Type: text/plain

	<HTML>
		<HEAD>
			<TITLE>Hello From HTML</TITLE>
		</HEAD>
		<BODY>
			<CENTER>
				<H1>
				   Hello From HTML
				</H1>
			</CENTER>
			Welcome to the wild and woolly world of HTML.
		</BODY>
	</HTML>
	-----------------------------11909339125713
	Content-Disposition: form-data; name="description"

	This is a job file
	-----------------------------11909339125713--

Note that the syntax is basically the same.

The above information should help in building your own parser for multi-part form uploads.  You can also refer to the source TCL code in 'add.tcl' or refer to the references for multi-part MIME types above.