Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How do I upload a file to a https server?

by meetraz (Hermit)
on Jun 07, 2004 at 17:07 UTC ( [id://362047]=note: print w/replies, xml ) Need Help??


in reply to How do I upload a file to a https server?

Jonathan, I think what you want is something like this:
(make sure data.txt is in the local directory, or specify the full path)
use strict; use LWP::Useragent; use HTTP::Request::Common; my $ua = new LWP::UserAgent; my $res = $ua->request(POST 'https://<address>/cgi-bin/upload.pl', Content_Type => 'form-data', Content => [ foo => 'bar', bar => 'baz', FILE1 => ["data.txt"], ] );
update: Changed file field name.

Replies are listed 'Best First'.
Re^2: How do I upload a file to a https server?
by Anonymous Monk on Jun 08, 2004 at 10:21 UTC
    Thanks guys - it's working. I tried using the form field 'File1' yesterday but did not realise it was case sensitive. FILE1 works.

    Thanks.

    Jonathan.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://362047]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-24 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found