cURL / Mailing Lists / curl-library / Single Mail

curl-library

ftp-upload with libcurl

From: <Matthias.Horvath_at_gmx.de>
Date: Wed, 17 Sep 2003 11:18:56 +0200 (MEST)

I´d like to know, how it´s possible to use libcurl for FTP-Upload in Perl.

I tried the following syntax, but the upload of the file doesn´t start.

#####################

my $curl = WWW::Curl::easy->new();

$code = $curl->setopt(CURLOPT_UPLOAD, 1);
$code = $curl->setopt(CURLOPT_URL, $ftp); # $ftp
= ftp://.../www
$code = $curl->setopt(CURLOPT_PROXYUSERPWD, $user); # $user = user:pw
$code = $curl->setopt(CURLOPT_PROXY, $proxy); # $proxy =
proxyip:port
$code = $curl->setopt(CURLOPT_INFILE, *SOURCE);
$code = $curl->setopt(CURLOPT_INFILESIZE, $byte); # $byte =
size of file in byte

$code = $curl->perform();
print $cgi->h4($code); # the result is always code 55

$curl->cleanup();

#####################

It seems curl is starting a HTTP-PUT. But I need a FTP-PUT.
If I don´t use the setting "CURLOPT_UPLOAD" the directory on ftp-server
will be listed in browser.
Moreover, I´d like to know how I can see the progress of the transfer.

I hope you can help me!

Thanks.

Matthias

-- 
+++ GMX - die erste Adresse für Mail, Message, More! +++
Getestet von Stiftung Warentest: GMX FreeMail (GUT), GMX ProMail (GUT)
(Heft 9/03 - 23 e-mail-Tarife: 6 gut, 12 befriedigend, 5 ausreichend)
Jetzt selbst kostenlos testen: http://www.gmx.net
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-17