in reply to Re: Is there a workaround for @ symbol in FTP username?
in thread Is there a workaround for @ symbol in FTP username?
Thanks for looking at this.my $un = 'username@domain.com; my $pw = 'password'; print "- FTPing report... "; my $ftp; my $status = 1; my ($connectattempts, $putattempts, $cwdattempts, $loginattempts) = +(0,0,0,0); STARTFTP: $ftp = Net::FTP->new("host.com", Debug => 0, Passive => 0) or $statu +s = 0; if (!$status) { if ($connectattempts < 3) { $connectattempts++; print "Session failed, retrying in 60 seconds\n"; $status = 1; sleep 60; goto STARTFTP; } else { goto FAILED; } } $status = $ftp->login($un,$pw); if (!$status) { if ($loginattempts < 3) { $loginattempts++; print "Login failed, retrying in 60 seconds\n"; $status = 1; sleep 60; goto STARTFTP; } else { goto FAILED; } } $ftp->binary(); $status = $ftp->put($outputfile,$outputfile); if (!$status) { if ($putattempts < 3) { $putattempts++; print "PUT command failed, retrying in 60 seconds\n"; $status = 1; sleep 60; goto STARTFTP; } else { goto FAILED; } } $ftp->quit; print "$file successfully uploaded.\n"; unlink $file; return 1; FAILED: print "$file was not transferred to host.com! Please upload manually +!\n\n"; return 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Is there a workaround for @ symbol in FTP username?
by QM (Parson) on Feb 20, 2013 at 11:15 UTC | |
by blackmage37 (Initiate) on Feb 20, 2013 at 11:24 UTC | |
|
Re^3: Is there a workaround for @ symbol in FTP username?
by tmharish (Friar) on Feb 20, 2013 at 10:44 UTC | |
by blackmage37 (Initiate) on Feb 20, 2013 at 10:48 UTC | |
by tmharish (Friar) on Feb 20, 2013 at 10:59 UTC | |
by blackmage37 (Initiate) on Feb 20, 2013 at 11:03 UTC | |
by tmharish (Friar) on Feb 20, 2013 at 11:12 UTC | |
|