How to allow anonymous file uploads via HTML ?

Transition

Banned
Sep 8, 2001
2,615
0
0
Hello everyone,

I'm trying to figure out a CGI script that will allow customers to upload images to a location on our server. I can't find the script anywhere - and quite frankly i don't know where to start. I just need people to be able to upload images to us.

Any help is appreciated.

Thanks guys
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
here's a start:

# UPLOAD FILE
$main_body .= "Upload file <form name=\"form1\" method=\"post\" action=\"upload.cgi\" enctype=\"multipart/form-data\"> <p><select name=\"cat\">";

foreach my $line(@categories){
$main_body .= "<option value=\"$line\">$line</option>\n";
}

$main_body .= "</select></p> <p><input type=\"text\" name=\"desc\"> description</p><p> <input type=\"file\" name=\"upload_file\"> </p> <p><input type=\"submit\" name=\"Submit\" value=\"upload file\"></p></form><hr>";


#and:

open(SAVE, ">users/$name/files/$cat/$save");
binmode SAVE;
while (<$fh>) {
print SAVE;
}
close(SAVE);