#!/usr/bin/perl # File: Uploader # # # # User set variables # $uploadurl = "http://www.cs.umn.edu/~doyle/AMY"; $path = "/home/grad23/doyle/.www/AMY"; %extrapaths = ("main" => ".", "pictures" => "pics", "thumbnails" => "thumbnails", "extra pictures" => "images"); @okhosts = ('www-users.cs.umn.edu','www.umn.edu','gold.tc.umn.edu','maroon.tc.umn.edu'); @safenames = ('cgi-bin', 'counter'); $password = "enter your password here"; $bgcolor = "#ffffff"; $overwrite = 0; # # Local Variables $ok = 0; # Main script # $| = 1; print "Content-type: text/html\n\n"; $lib = "./Library"; # Read in core BBS variables require "$lib/cgi-lib.pl"; &ReadParse; #print &PrintVariables; #file these 2 in if necessary # $cgi_lib'maxdata = $maximum_attachment_size; # $cgi_lib'writefiles = "$attach_dir"; if ( $ENV{'CONTENT_LENGTH'} == "" ) { #if form hasn't been submitted &header("Upload Form"); &gen_form; &footer; } elsif ($in{'dir'} ne "" ) { &Verify; &header("Current Directory Listing"); &print_dir; &gen_full; &footer; } else { &Verify; &get_data; &write_it; #change permissions of file chmod (0644, "upload$path/$extrapath/$newfile"); #show thank you and let add more. &header("File Uploaded"); print qq~
Feel free to upload another
~; &gen_full; &footer; } #else #{ # &header("Error! Wrong Version"); # print qq~ #
You cannot upload a file to this server.~; &footer; exit; } } } sub get_data { $extrapath = $in{"extrapath"}; if (!(-e "$path/$extrapath" )) { &header("Directory doesn't exist"); print qq~