#####Create Perl upload script open(FILE, ">$basedir$q_brieftitle/upload.cgi") || &diedebug("$header Could not create file $basedir$q_brieftitle/upload.cgi: $! . It's possible that your web server will not let me create files even if I own the directory. If you have chmodded $basedir$q_brieftitle/ to 777 and you are still getting this message, then you will need to create your quizzes and answerfiles by hand. :( $footer"); flock(FILE, 2); &get_date; print FILE (" #!/usr/bin/perl \n"); print FILE (" $basedir = \"/home/sites/stuff/users/web/up2\"; \n"); print FILE (" $allowall = \"yes\"; \n"); print FILE( " $theext = \".gif\"; \n"); print FILE (" $donepage = \"http://www.yourpage.com/\"; \n"); print FILE (" ## DO NOT EDIT OR COPY BELOW THIS LINE ## \n"); print FILE (" use CGI; \n"); print FILE (" $onnum = 1; \n"); print FILE (" while ($onnum != 11) { \n"); print FILE (" my $req = new CGI; \n"); print FILE (" my $file = $req->param(\"FILE$onnum\"); \n"); print FILE (" if ($file ne \"\") { \n"); print FILE (" my $fileName = $file; \n"); print FILE (" $fileName =~ s!^.*(\\|\/)!!; \n"); print FILE (" $newmain = $fileName; \n"); print FILE (" if ($allowall ne \"yes\") { \n"); print FILE (" if (lc(substr($newmain,length($newmain) - 4,4)) ne $theext){ \n"); print FILE (" $filenotgood = \"yes\"; \n"); print FILE (" } \n"); print FILE (" } \n"); print FILE (" if ($filenotgood ne \"yes\") { \n"); print FILE (" open (OUTFILE, \">$basedir/$fileName\"); \n"); print FILE (" print \"$basedir/$fileName
\"; \n"); print FILE (" while (my $bytesread = read($file, my $buffer, 1024)) { \n"); print FILE (" print OUTFILE $buffer; \n"); print FILE (" } \n"); print FILE (" close (OUTFILE); \n"); print FILE (" } \n"); print FILE (" } \n"); print FILE (" $onnum++; \n"); print FILE (" } \n"); print FILE (" print \"Content-type: text/html\n\"; \n"); print FILE (" print \"Location:$donepage\n\n\"; \n"); close(FILE);