D
dtfcalibrator
I've been struggling with this forever now. Hopefully someone can help
Lets say you have the following:
proxy server: my.proxy.com
proxy username: proxyuser
proxy password: proxypassword
ftp server: my.ftp.com
ftp username: ftpuser
ftp password: ftppassword
file to PUT: myTextFile.txt
I've been trying to use LWP::UserAgent, HTTP::Headers, and
HTTP::Request without any real success.
Here's where I gave up (I'm not working on proxy auth yet):
use File::stat;
use LWP::UserAgent;
$stats = stat("myTextFile.txt");
$fileSize = $stats->size;
$ua = LWP::UserAgent->new;
$ua->proxy(['http', 'ftp'], 'http://my.proxy.com');
$header = HTTP::Headers->new;
$header->authorization_basic("ftpuser", "ftppassword");
open(FH, "myTextFile.txt");
read(FH, $buf, $fileSize);
$req = HTTP::Request->new("PUT", "ftp://my.ftp.com/myTextFile.txt",
$header);
$req->content($buf);
$response = $ua->request($req);
Lets say you have the following:
proxy server: my.proxy.com
proxy username: proxyuser
proxy password: proxypassword
ftp server: my.ftp.com
ftp username: ftpuser
ftp password: ftppassword
file to PUT: myTextFile.txt
I've been trying to use LWP::UserAgent, HTTP::Headers, and
HTTP::Request without any real success.
Here's where I gave up (I'm not working on proxy auth yet):
use File::stat;
use LWP::UserAgent;
$stats = stat("myTextFile.txt");
$fileSize = $stats->size;
$ua = LWP::UserAgent->new;
$ua->proxy(['http', 'ftp'], 'http://my.proxy.com');
$header = HTTP::Headers->new;
$header->authorization_basic("ftpuser", "ftppassword");
open(FH, "myTextFile.txt");
read(FH, $buf, $fileSize);
$req = HTTP::Request->new("PUT", "ftp://my.ftp.com/myTextFile.txt",
$header);
$req->content($buf);
$response = $ua->request($req);