| Apache2::ASP::Request - Incoming request object. |
#============================================================================== sub FileUpload { my ($s, $field, $arg) = @_;
confess "Request.FileUpload called without arguments" unless defined($field);
my $cgi = $s->context->cgi;
my $ifh = $cgi->upload($field); my %info = (); my $upInfo = { };
if( $cgi->isa('Apache2::ASP::SimpleCGI') ) { no warnings 'uninitialized'; %info = ( ContentType => $cgi->upload_info( $field, 'mime' ), FileHandle => $ifh, BrowserFile => $s->Form->{ $field } . "", 'Content-Disposition' => 'attachment', 'Mime-Header' => $cgi->upload_info( $field, 'mime' ), ); } else { $upInfo = $cgi->uploadInfo( $ifh ); no warnings 'uninitialized'; %info = ( ContentType => $upInfo->{'Content-Type'}, FileHandle => $ifh, BrowserFile => $s->Form->{ $field } . "", 'Content-Disposition' => $upInfo->{'Content-Disposition'}, 'Mime-Header' => $upInfo->{type}, ); }# end if()
if( wantarray ) { return %info; } else { if( $arg ) { return $info{ $arg }; } else { return $ifh; }# end if() }# end if()
}# end FileUpload()
Apache2::ASP::Request - Incoming request object.
my $form_args = $Request->Form; my $querystring = $Request->QueryString; my $cookies = $Request->Cookies; my $cookie = $Request->Cookies('name'); my $vars = $Request->ServerVariables; my $var = $Request->ServerVariables('HTTP_HOST');
The request represents a wrapper around incoming form, querystring and cookie data.
If called with no arguments, returns %ENV. If called with an argument, returns
$ENV{$name} where $name is the value of the argument.
If called with no arguments, returns a hash of all cookies. Otherwise, returns
the value of the cookie named $name.
Returns a hashref of all querystring and form data.
Returns the querystring portion of the current request.
It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html to submit bug reports.
Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.
John Drago <jdrago_999@yahoo.com>
Copyright 2008 John Drago. All rights reserved.
This software is Free software and is licensed under the same terms as perl itself.
| Apache2::ASP::Request - Incoming request object. |