Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Accepted Data Connection "error" using put method of Net::FTP

by kschwab (Priest)
on Sep 02, 2013 at 04:15 UTC ( #1051882=note: print w/ replies, xml ) Need Help??


in reply to Accepted Data Connection "error" using put method of Net::FTP

It appears that $ftp->put is supposed to return the remote filename created. Being a little pedantic, it seems the right thing to test for would be if the return value is defined. Suppose you "put" a file named '0'. Your current test would fail. Try defined($ftp->put($file)) or die(); Also print out the value of $! in your die statement, it might be helpful.

Looking quickly at the source for Net::FTP, another thing you might try is using $ftp->put_unique instead of $ftp->put. It flows through some different logic where the return value is set a bit differently. Same goes for calling $ftp->binary before doing the put. Slightly different logic that could affect the return value.


Comment on Re: Accepted Data Connection "error" using put method of Net::FTP
Re^2: Accepted Data Connection "error" using put method of Net::FTP
by Only1KW (Sexton) on Sep 02, 2013 at 20:20 UTC
    I added the binary call and tried uploading the same file again. It worked this time. I'll see if it continues to work over time. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1051882]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-12-21 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls