okay this is what i have so far

this will upload text files fine and out put the text to the screen as well 
as save it to the file name i give it, but i need it to work with images as 
well can somebody show me how this can be done?

Html file
__________
<form method='POST' enctype='multipart/form-data' action='upload.cgi'>
File to upload: <input type=file name=upfile><br>
Notes about the file: <input type=text name=note><br>
<br>
Remote File name:<input type=text name=fname><br>
<input type=submit value=Press> to upload the file!
</form>

End HTML


Start CGI


#!/usr/bin/perl

require "cgi-lib.pl";

$cgi_lib'maxdata = 50000;

$ret = &ReadParse;

open new,">>$in{'fname'}";  # Open log and print new count
        print new $in{'upfile'};
    close new;

print &PrintHeader;
print &HtmlTop("File Upload Results");
print <<EOT;
$fname
<p>You've uploaded a file.  Your notes on the file were:<br>
<blockquote>$in{'note'}</blockquote><br>
<p>The file's contents are:
<pre>
$in{'upfile'}
</pre>
EOT

print &HtmlBot;

End of CGI




Reply via email to