bunch of fixes

This commit is contained in:
Matthew Wilson 2005-07-19 17:16:41 +00:00
parent 02e687d04c
commit 156f48f465
10 changed files with 45 additions and 23 deletions

View file

@ -190,9 +190,12 @@ Provide the form variable name to which the file being uploaded is assigned. Not
sub addFileFromFormPost {
my $self = shift;
my $formVariableName = shift;
return "" if (WebGUI::HTTP::getStatus() =~ /^413/);
my $attachmentLimit = shift;
return "" if (WebGUI::HTTP::getStatus() =~ /^413/);
my $filename;
my $attachmentCount = 1;
foreach my $tempPath ($session{cgi}->upload($formVariableName)) {
last if $attachmentCount > $attachmentLimit;
if ($tempPath =~ /([^\/\\]+)$/) {
$filename = $1;
} else {
@ -206,6 +209,7 @@ sub addFileFromFormPost {
$filename = WebGUI::URL::makeCompliant($filename);
my $bytesread;
my $file = FileHandle->new(">".$self->getPath($filename));
$attachmentCount++;
if (defined $file) {
my $buffer;
binmode $file;