diff Lib/IMPL/Web/Application.pm @ 138:c5bc900eefd3

IMPL::Web::Application: Fixed file uploading Minor improvements in the IMPL::Web::TT::Form
author wizard
date Thu, 01 Jul 2010 04:25:07 +0400
parents 06a34c197b05
children 4267a2ac3d46
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application.pm	Tue Jun 29 00:37:05 2010 +0400
+++ b/Lib/IMPL/Web/Application.pm	Thu Jul 01 04:25:07 2010 +0400
@@ -99,9 +99,13 @@
 
 use Encode;
 
+our $NO_DECODE = 0;
+
 sub param {
 	my $this = shift;
 	
+	return $this->SUPER::param(@_) if $NO_DECODE;
+	
 	if (wantarray) {
 		my @result = $this->SUPER::param(@_);
 		
@@ -114,6 +118,19 @@
 
 }
 
+sub upload {
+	my $this = shift;
+	
+	local $NO_DECODE = 1;
+	my $oldCharset = $this->charset();
+	$this->charset('ISO-8859-1');
+	
+	my $fh = $this->SUPER::upload(@_);
+	
+	$this->charset($oldCharset);
+	return $fh;
+}
+
 1;
 
 __END__