$ftp->put("$file") unless $ftp->rename("$file","$file");