Perl Net::FTP problem
I've got a perl cron job that runs every week and needs to upload output to an ftp server. I've thought about using a shell script, but then found Net::FTP via cpan. I've had great luck with Net::Mail so I figured Net::FTP would work just as well. Unfortunately no. It logs in fine, change directory works, delete file works, but when I try to upload a file via the "put" command, no dice. I've tried the most simple test but it always gives output "226 transfer complete" but the file on the ftp server contains zero bytes. Google searching has uncovered quite a few other people who've run into this, but no solutions.
I've tried two different FTP servers, I've tried specifying the source file name with and without the full path but either way gives the same result (it seems like it could be a source file issue since the file name shows up on the remote server but with zero bytes, like it gets the file name but not the actual file). Anyone here using it successfully? My skills are not up to debugging Net::FTP or the packages it relies on unfortunately. Here's my code: Code:
use Net::FTP; Code:
Net::FTP>>> Net::FTP(2.77) |
Try running it with Debug set to 3 and see what you get. You may not have permissions to write to the directory or is using the wrong port.
|
Thanks for the reply. Setting debug to 3 gives the same output (the docs don't indicate that there are varying debug levels in either Net::FTP or the Net::Cmd package which it uses). It isn't a permissions issue because I'm able to write to both ftp servers using an ftp client on my machine. It can't be the wrong port because it's connecting fine and doing everything ok except sending a file.
|
All times are GMT -5. The time now is 08:06 AM. |