This should fix your problem. (add the binary line).

$ftp->cwd("/pub/datfiles/english/");
$ftp->binary(); #changes ftp to binary mode
$ftp->get("$datefile");

Steven


-----Original Message-----
From: agalal [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 13, 2002 6:27 AM
To: Perl Mailing List
Subject: FTP................!!!


Hi all,

I have case her with ftp,I'm newbie in perl so be paint with me.

my case is as follow when i use the Net::FTP

i send the files but i found  the size of the file is 0 bye size,also when i
try to get down some thing from FTP server using that Lib (Net::FTP) the
file be larger than the source file.................I don't know why??But
may i do some thing wrong.

//////////////That i used to get download the last update for
anti-virus/////////////////////////////

use Net::FTP;
open (Datefile,"+<nai.txt") || die "couldn't open the file:$!";  
seek(Datefile,39,0);

#$datefile=getc(Datefile);
read(Datefile,$datefile,12,0);

close(Datefile);


    $ftp = Net::FTP->new("ftp.nai.com", Debug => 0);
    $ftp->login("anonymous",'[EMAIL PROTECTED]');
    $ftp->cwd("/pub/datfiles/english/");
    $ftp->get("$datefile");
    $ftp->quit; 

exit 0;
/////////////////////////////////////////////////
But the file i get download with not the same size like the source in the
www.nai.com

////////////////////////////That is the script i used to send files but the
size of the file sent was 0byte////////////////

use Net::FTP;

    $ftp = Net::FTP->new("10.10.10.10", Debug => 0);
    $ftp->login("usernaem",'password');
    $ftp->cwd("/www/Radiofiles/");
    
    opendir(DIR,"D:\\Radio_Update\\output") || die "can't opendir $some_dir:
$!";
    @filename=grep {/^\w{1,}\.\w{1,3}/} readdir(DIR);

for $filename(@filename)
     {
       $ftp->put("D:\\Radio_Update\\output\\$filename");

     }
    $ftp->quit; 

exit 0;


////////////////////////////////////////////////////////////////////////////
///////////////



what i want her in first step ,How i can dedicated that when i send files
using that Lib the connection is down or is the file exist there in  the ftp
server when i upload the file so no need in that case to send it again.

i will be thanks for help me .....
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to