# These are expected errors, because the CGI parameters are blank on the command line. [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in concatenation (.) or string at /Library/WebServer/Documents/Q4D/upload.cgi line 24. [Wed Feb 27 15:33:26 2008] upload.cgi: source: at /Library/WebServer/Documents/Q4D/upload.cgi line 24 [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in concatenation (.) or string at /Library/WebServer/Documents/Q4D/upload.cgi line 24. [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in hash element at /Library/WebServer/Documents/Q4D/upload.cgi line 24. [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in concatenation (.) or string at /Library/WebServer/Documents/Q4D/upload.cgi line 24. [Wed Feb 27 15:33:26 2008] upload.cgi: : at /Library/WebServer/Documents/Q4D/upload.cgi line 24 [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in concatenation (.) or string at /Library/WebServer/Documents/Q4D/upload.cgi line 27. [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in at /Library/WebServer/Documents/Q4D/upload.cgi line 28. [Wed Feb 27 15:33:26 2008] upload.cgi: readline() on unopened filehandle at /Library/WebServer/Documents/Q4D/upload.cgi line 28. [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in concatenation (.) or string at /Library/WebServer/Documents/Q4D/upload.cgi line 33. [Wed Feb 27 15:33:26 2008] upload.cgi: Use of uninitialized value in at /Library/WebServer/Documents/Q4D/upload.cgi line 34. [Wed Feb 27 15:33:26 2008] upload.cgi: readline() on unopened filehandle at /Library/WebServer/Documents/Q4D/upload.cgi line 34. Content-Type: text/html; charset=ISO-8859-1 Thanks!

Thanks for uploading


Go back. #!/opt/local/bin/perl use strict; use diagnostics; use warnings; use CGI; use CGI::Carp; use YAML; my @data; eval { @data = Load('data.dat'); }; @data = [] if $@; my $upload_dir = "."; my $cgi = new CGI; my %data; $data{'filename'}= $cgi->param('filename'); $data{'image'} = $cgi->param('img_filename'); $data{'source'} = $cgi->param('source'); $data{'url'} = $cgi->param('url'); $data{'date'} = localtime; $data{'author'} = $cgi->param('author'); $data{'description'} = $cgi->param('descr'); carp "$_: $data{$_}" foreach (each %data); push @data, %data; my $fh = $cgi->upload('filename'); open (F, '>'.$data{'filename'}); while (<$fh>) { print F; } close F; my $img_fh = $cgi->upload('img_filename'); open F, '>'.$data{'image'}; while (<$img_fh>) { print F; } open O,'>data.dat'; print O Dump(@data); print $cgi->header,'Thanks!

Thanks for uploading


Go back.';