mifflin has asked for the wisdom of the Perl Monks concerning the following question:
I have client that wants me to send him a file via http.
The potential problem here is this file may be rather large (megabytes).
The usual way that I send data through http is via the POST method like...
Is there a better way to send large files via http?
The potential problem here is this file may be rather large (megabytes).
The usual way that I send data through http is via the POST method like...
This works but can result it memory issues if the variable $sendthis is large.my $headers = HTTP::Headers->new(); $headers->header('Content-Type' => 'text/plain; charset=utf-8'); $headers->header('Content-Length' => length($sendthis)); my $request = HTTP::Request->new('POST', $url, $headers, $sendthis) +; $request->protocol('HTTP/1.1'); my $browser = LWP::UserAgent->new(); my $response = $browser->request($request); my $gotthis = $response->content();
Is there a better way to send large files via http?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: sending a large file via http
by rhesa (Vicar) on Jun 18, 2007 at 22:17 UTC | |
by mifflin (Curate) on Jun 18, 2007 at 22:52 UTC | |
by rhesa (Vicar) on Jun 18, 2007 at 23:13 UTC | |
by mifflin (Curate) on Jun 18, 2007 at 23:42 UTC | |
by tty04 (Initiate) on Nov 09, 2007 at 23:28 UTC | |
Re: sending a large file via http
by Joost (Canon) on Jun 18, 2007 at 21:41 UTC | |
by Util (Priest) on Jun 19, 2007 at 00:02 UTC |
Back to
Seekers of Perl Wisdom