How to use Apache2::Upload

2005-11-11 Thread Boysenberry Payne
In the Apache2::Upload doc it gives the following example:

use Apache2::Upload;
$req = Apache2::Request->new($r);
$upload = $req->upload(foo);

If I'm using this inside of a mod_perl handler do I need to do
$req = Apache2::Request->new($r);
where $r is my request handle?
Or am I getting confused?

So would the following be correct?

sub handler {

my $r = shift;
my $req = Apache2::Request->new( $r );
my $upload = $req->upload( foo );
my $fh = $upload->fh;
}

In the above would $fh be appropriate to use with Net::FTP->put( $fh )?

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com


Re: How to use Apache2::Upload

2005-11-11 Thread Boysenberry Payne
Also, are there equivalents to:

$CGI::DISABLE_UPLOADS
and
$CGI::POST_MAX
???

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Nov 11, 2005, at 3:56 PM, Boysenberry Payne wrote:

In the Apache2::Upload doc it gives the following example:

use Apache2::Upload;
$req = Apache2::Request->new($r);
$upload = $req->upload(foo);

If I'm using this inside of a mod_perl handler do I need to do
$req = Apache2::Request->new($r);
where $r is my request handle?
Or am I getting confused?

So would the following be correct?

sub handler {

my $r = shift;
my $req = Apache2::Request->new( $r );
my $upload = $req->upload( foo );
my $fh = $upload->fh;
}

In the above would $fh be appropriate to use with Net::FTP->put( $fh )?

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com


Re: How to use Apache2::Upload

2005-11-11 Thread Philip M. Gollucci

In the Apache2::Upload doc it gives the following example:

I would recommend that you check out:

http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__apr__request__cookie.html

instead ... Apache2::Cookie was just let in for back compat and we don't 
generally recommend it anymore.



--
--
Love is not the one you can picture yourself marrying,
but the one you can't picture the rest of your life without.

It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone...

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com


Re: How to use Apache2::Upload

2005-11-11 Thread Philip M. Gollucci

Boysenberry Payne wrote:

Also, are there equivalents to:

$CGI::DISABLE_UPLOADS
and
$CGI::POST_MAX
???

http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__apr__request.html

Look for
$req-disable_uploads()

and

$req-read_limit($set)

Respectively.

HTH



--
--
Love is not the one you can picture yourself marrying,
but the one you can't picture the rest of your life without.

It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone...

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com


Re: How to use Apache2::Upload

2005-11-11 Thread Michael Peters


Philip M. Gollucci wrote:
 In the Apache2::Upload doc it gives the following example:
 
 I would recommend that you check out:
 
 http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__apr__request__cookie.html
 
 
 instead ... Apache2::Cookie was just let in for back compat and we don't
 generally recommend it anymore.

This is, at least to me, annoying. Apache::Request's API is pretty
simple and familiar to those who know CGI.pm. APR::Request is probably
more flexible, and more like the underlying C API. I don't think this
means that the Apache2::Request modules should be abandoned.

Is there any interest in having someone maintain the Apache2::Request
(Upload, Cookie, etc) family to have the same old API? This shouldn't
detract from the APR::Request modules in any way, and they can still be
encouraged if that's the general consensus. They can even be spun off
into their own distribution and just use the APR::Request underneath.

Thoughts?

-- 
Michael Peters
Developer
Plus Three, LP



Re: How to use Apache2::Upload

2005-11-11 Thread Boysenberry Payne
What is $pool in:

APR::Request::Custom->handle($pool, 
$query_string,
$cookie_header,
$parser,
$read_limit,
$brigade)

and how do I get each of the values for this?

Should I use:

APR::Request->handle( ... );

or the above?

Right now I'm doing the following:

sub handle {

$r = shift;

# uploads	
$req = Apache2::Request->new( $r );
$upload = $req->upload( upload_field_name );

# cookies
$jar = Apache2::Cookie::Jar->new( $r );
$cookies = $self->{jar}->cookies();
$table = Apache2::Cookie->fetch( $r );
}

is there a better way, that I'm not getting?

Thank you,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Nov 11, 2005, at 5:48 PM, Philip M. Gollucci wrote:

Boysenberry Payne wrote:
Also, are there equivalents to:
$CGI::DISABLE_UPLOADS
and
$CGI::POST_MAX
???
http://httpd.apache.org/apreq/docs/libapreq2/group__apreq__xs__apr__request.html

Look for
$req->disable_uploads()

and

$req->read_limit($set)

Respectively.

HTH



-- 
--
Love is not the one you can picture yourself marrying,
but the one you can't picture the rest of your life without.

It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone...

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com