Update of /cvsroot/sandweb/sandweb/lib/SandWeb
In directory usw-pr-cvs1:/tmp/cvs-serv28012/lib/SandWeb
Modified Files:
File.pm
Log Message:
* now *really* fixed wierd file line space issue.
Index: File.pm
===================================================================
RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -U2 -r1.44 -r1.45
--- File.pm 22 Feb 2002 23:06:27 -0000 1.44
+++ File.pm 23 Feb 2002 04:24:37 -0000 1.45
@@ -128,4 +128,6 @@
my $filename = $self->{'filename'};
my $log = $self->{'log_obj'};
+ # passed from CGI->upload - FileHandle of incoming file.
+ my $filehandle = $args{'filehandle'};
# begin workaround for IE/Windows upload behaviour
@@ -135,13 +137,9 @@
# end workaround for IE/Windows upload behaviour
- my $filehandle = $args{'filehandle'};
-
- open UPLOADFILE, "> $location/$filename";
-
- while ( <$filehandle> )
- {
- print UPLOADFILE;
- }
+ my @file = <$filehandle>;
+ chomp @file;
+ open UPLOADFILE, ">$location/$filename";
+ print UPLOADFILE join("\n", @file);
close UPLOADFILE;
}
@@ -304,10 +302,8 @@
my $filename = $self->{'filename'};
- my $contents = _do_file_read(
+ return _do_file_read(
'location' => "$location",
'filename' => "$filename",
);
-
- return $contents;
}
@@ -382,8 +378,6 @@
my $return;
- my @data = split(/\n/, $contents);
if (open (FILE, ">$location/$filename")) {
- $log->debug('dump', @data);
- print FILE join('', @data);
+ print FILE join('', $contents);
} else {
$log->debug("error opening $location/$filename for writing: $!");
@@ -405,9 +399,9 @@
my $log = $args{'log_obj'};
- open (FILE, "< $location/$filename");
+ open (FILE, "<$location/$filename");
my @contents = <FILE>;
close FILE;
- return "@contents";
+ return join('', @contents);
}
|