netroact
02-07-2010, 08:11 PM
Dear Friends:
I am making an image upload script, and I am trying to use a file extension check sub routine that validates files only with a proper image file exension. It works on zip files and doc files. but when I try an executable file, I guess it crashes my internet. My internet slows to a crawl until I restart my modem. I tried this several times, and the same thing happened.
So, I abandoned the upload script, and made a simple script that prints the file name. Same thang happened.
Here's the form:
<form method="post" action="/cgi-bin/resizer/resizer.pl" ENCTYPE="multipart/form-data">
<b>Select File:</b> <input type="file" name="file"> (Browse your computer for an image.)
<br>
<br>
<input type="submit" name="submit" value="Submit"></center>
</form>
The script:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $query = new CGI;
my $file = $query->param("file");
print "Content-type: text/html\n\n";
print "$file";
I don't understand what is happening. Is my browser trying to execute the file?
I am making an image upload script, and I am trying to use a file extension check sub routine that validates files only with a proper image file exension. It works on zip files and doc files. but when I try an executable file, I guess it crashes my internet. My internet slows to a crawl until I restart my modem. I tried this several times, and the same thing happened.
So, I abandoned the upload script, and made a simple script that prints the file name. Same thang happened.
Here's the form:
<form method="post" action="/cgi-bin/resizer/resizer.pl" ENCTYPE="multipart/form-data">
<b>Select File:</b> <input type="file" name="file"> (Browse your computer for an image.)
<br>
<br>
<input type="submit" name="submit" value="Submit"></center>
</form>
The script:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $query = new CGI;
my $file = $query->param("file");
print "Content-type: text/html\n\n";
print "$file";
I don't understand what is happening. Is my browser trying to execute the file?