How to upload a file starting with Cleanview using net::ftp in perl? -


i'm trying upload file starting cleanview , full filename have random characters in middle "cleanview.45673.log". need find file filename starting cleanview , upload. tried code below not working. file created on server, size 0 bytes. please help.

$login = 'abc'; $pass = 'xyz'; $dir = '/projects/ban/android/bx'; $ftp = net::ftp->new('10.xxx.xx.xxx' ,debug => 1) or die "cannot connect"; print("ftp session opened logs\n"); $ftp->login($login, $pass) or die "can't log $login in\n"; $ftp->pasv(); $ftp->cwd($dir); @cleanviewlog = glob "cleanview*.log"; $ftp->pasv; for(@cleanviewlog) {  print "transferring cleanview log $_\n";  $ftp->put("$_") or die $ftp->message;  sleep(5); } 

here debug message shown:

transferring cleanview log cleanview.66411936.log net::ftp=glob(0x202697f0)>>> allo 1958 net::ftp=glob(0x202697f0)<<< 227 entering passive mode (10,131,32,173,161,61) net::ftp=glob(0x202697f0)>>> port 10,32,128,60,230,164 net::ftp=glob(0x202697f0)<<< 202 allo command ignored. net::ftp=glob(0x202697f0)>>> stor cleanview.66411936.log net::ftp=glob(0x202697f0)<<< 200 port command successful. consider using pasv. port command successful. consider using pasv. 

if file being transferred, has 0 size, io buffered , transferring file after created before contents of buffer flushed. maybe need close filehandle creates file? or flush buffer writing file? there's not enough information in question tell sure solution is.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -