[an error occurred while processing this directive]

GIF Upload Example

This page allows you to upload a GIF file, which then will then be returned to you as data having MIME type image/gif.

Note that I have set the script to limit the size of the file to 0.5 Mbytes (524,288 bytes) so that the server doesn't get swamped with data.

The file upload form looks just like any other form except that:

  1. the form tag must specify the POST method
  2. the form tag must specify an enctype of multipart/form-data
  3. the form must contain an <input type=file> element.
You can do a view source on this document to see all the elements.

The processing of a file upload is exactly like that of ordinary data; just make a call to ReadParse and the data will either be put in %in or some other variable that you specify. If you want to write files to disk (rather than store the data in memory), then you also need to set the variable $cgi_lib'writefiles to indicate the directory where the data should be written. Other variables allow you to further customize the file upload.

See The cgi-lib.pl Home Page for more information.

Please fill in the file-upload form below

File to upload:
to upload the file!