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:
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.