Gossamer Forum
Home : General : Perl Programming :

Net::FTP IN BINARY MODE

Quote Reply
Net::FTP IN BINARY MODE
Help!!
I can't upload in binary mode with net::ftp. The default transfer mode is ascii and my images do not work.
Do you know the syntax for a binary transfer?
---
$ftp = Net::FTP->new("$host", Debug => 0) or &error;
---

thank you.

Quote Reply
Re: Net::FTP IN BINARY MODE In reply to
$ftp->type(binary);

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Net::FTP IN BINARY MODE In reply to
Hi PaulWilson!

It doesn't work for me :(
Can you have a look?
Thank you.

------------------
use Net::FTP;

$ftp = Net::FTP->new("$host", Debug => 0) or &error;
$ftp->type(binary);
#i also tried with $ftp->type("binary");
$ftp->login("$username","$pass") or &error;
$ftp->cwd("$path") or &error;

$ftp->put("$file");


Quote Reply
Re: Net::FTP IN BINARY MODE In reply to
$ftp->binary;

?

One or the other should work.

Do you get an error?

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Net::FTP IN BINARY MODE In reply to
no errors but images are corrupted (you know... we can't upload in ascii mode image files)
ascii mode is the default in net::ftp

Quote Reply
Re: Net::FTP IN BINARY MODE In reply to
As far as I know, something like this should work.....

use Net::FTP;

$ftp = Net::FTP->new("$host", Debug => 0) or &error;
$ftp->login("$username","$pass") or &error;
$ftp->cwd("$path") or &error;
$ftp->binary;
$ftp->put("$file");

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Net::FTP IN BINARY MODE In reply to
yeah, it generally helps to be logged into the ftp server before issuing transfer methods;)
it would be like querying for the number of emails you have before you logged into the email server.

-g


s/(\d{2})/chr($1)/ge + print if $_ = '8284703280698276687967';
Quote Reply
Re: Net::FTP IN BINARY MODE In reply to
LOL....good point....Wink

Andy

webmaster@ace-installer.com
http://www.ace-installer.com