in reply to Image Uploading

first of all: remember to use start_multipart_form and not just start_form() when you generate the input form, as in
#!/usr/bin/perl -w use CGI qw/:standard/; print header(); print start_html(); print start_multipart_form(-action=>'test.pl'); print filefield('file_name'), submit(); print end_form; print end_html;
then (test.pl)
#!/usr/bin/perl -w use strict; ## ALLWAYS!!!! use CGI; use CGI::Carp qw(fatalsToBrowser); $CGI::POST_MAX=1024 * 25; my $q = new CGI; my $file_name = $q->param('file_name'); my $fh = $q->upload('file_name'); # this is needed because use strict if($fh) { open OUT, ">/tmp/output.gif" || die "cannot open: $!"; binmode OUT; #just in case you are under windows print $q->header('image/gif'); my $data; while(read($fh,$data,1024)) { print $data; print OUT $data; } close OUT; } else { print $q->header(); print $q->start_html(); print $q->h1('no upload file'); print $q->end_html(); }