in reply to Re^2: On-disk multipart/form-data part extraction
in thread On-disk multipart/form-data part extraction
nginx-embedded perl module
never heard of it :)
So http://wiki.nginx.org/HttpPerlModule? In that case,
;P
:)
my $body = Nginx_Body ( $r ); my $uploads = $body->upload; # hashref ## cleanup temp files undef $uploads; undef $body; sub Nginx_Body { my $r = shift; my $tmpdir = shift; my $content_type = $r->headers_in('Content-Type'); my $content_length = $r->headers_in('Content-Length'); my $body = HTTP::Body->new( $content_type, $content_length ); $body->tmpdir( $tmpdir ) if $tmpdir; my $length = $content_length; open my($bodyfh), '<:raw', $r->request_body_file or die $!; while ( $length ) { my $read = read( $bodyfh, my $buffer, ( $length < 8192 ) ? $length : 8192 ); my $bufferlength = length($buffer); die "IMPOSSIBLE $read != $bufferlength " if $read != $bufferle +ngth ; $length -= $bufferlength; $body->add( $buffer ); } return $body; }
Although, after reading a bit from Nginx - full-featured perl support for nginx nginx might have this feature already , or at least it should :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: On-disk multipart/form-data part extraction
by Conquistadog (Novice) on Dec 24, 2012 at 18:44 UTC |