Bishma has asked for the wisdom of the Perl Monks concerning the following question:
Unfortunatly it's mostly uncommented, but I've made sense of most of it. My question is this: I want this script to only accept .jpg files so I need to know how to make this test.if ( $q->param() ) { my $filehandle = $q->param('file'); binmode($filehandle); open(OUT,">/var/www/html/toiletben/pictures/tempout") || die $!; binmode(OUT); # process $filehandle { my $buffer; while ( read($filehandle,$buffer,1024) ) { print OUT $buffer; } } close(OUT); print $q->header, $q->start_html, $q->p('File uploaded'), $q->end_html; exit(0); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: checking file types in a perl upload script
by rob_au (Abbot) on Feb 16, 2002 at 08:28 UTC | |
|
Re: checking file types in a perl upload script
by kwoff (Friar) on Feb 16, 2002 at 08:24 UTC |