Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Net::FTP error on put: Bad command sequence
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mnaga...@gmail.com  
View profile  
 More options Apr 18 2006, 4:11 pm
Newsgroups: comp.lang.perl.misc
From: mnaga...@gmail.com
Date: 18 Apr 2006 13:11:55 -0700
Local: Tues, Apr 18 2006 4:11 pm
Subject: Net::FTP error on put: Bad command sequence
This is the code producing the error:
<---------------snip----------->
use strict;
use warnings;
use Net::FTP;

my $firm_user = 'string1';
my $firm_pass = "string2";
my $firm_dir = "string3";
my $outfile = "string4";

#Open a socks FTP connection
my $ftp = Net::FTP->new('socks');

$ftp->login($firm_user, $firm_pass)
       or die print("ERROR! Unable to connect to the FTP server: ",
$ftp->message);

$ftp->ascii();

$ftp->cwd($firm_dir)
       or die print("ERROR! Unable to 'cd' to $firm_dir directory: ",
$ftp->message);

$ftp->put($outfile)
       or die print("ERROR! Unable to ftp the file at this time: ",
$ftp->message);

$ftp->quit;
<--------end snip-------->

I tried, ls, pwd, etc and all these work. I tried the FTP from the
shell and it works just fine. Any clues as to what might cause this
error.

BTW this program did work in the past. I am clueless as to the source
of the error!

Thanks,

-mouli.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
J. Gleixner  
View profile  
 More options Apr 18 2006, 7:20 pm
Newsgroups: comp.lang.perl.misc
From: "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
Date: Tue, 18 Apr 2006 18:20:06 -0500
Local: Tues, Apr 18 2006 7:20 pm
Subject: Re: Net::FTP error on put: Bad command sequence

First, the die command works just fine, no need to die print:

$ftp->cwd($firm_dir)
        or die "ERROR! Unable to 'cd' to $firm_dir directory: " . $ftp->message;

perldoc -f die

Second, add Debug => 1, to the new to see if that helps.

Third, does $outfile exist?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mnaga...@gmail.com  
View profile  
 More options Apr 19 2006, 11:48 am
Newsgroups: comp.lang.perl.misc
From: mnaga...@gmail.com
Date: 19 Apr 2006 08:48:24 -0700
Local: Wed, Apr 19 2006 11:48 am
Subject: Re: Net::FTP error on put: Bad command sequence
J.Gleixner,

I included 1 & 2 as recommended by you.
On 3, yes $outfile does exist. If it doesn't, I get a different error
(local file not found error).

Here is the result of the debug trace:

Outfile: a
Net::FTP>>> Net::FTP(2.75)
Net::FTP>>>   Exporter(5.562)
Net::FTP>>>   Net::Cmd(2.26)
Net::FTP>>>   IO::Socket::INET(1.25)
Net::FTP>>>     IO::Socket(1.26)
Net::FTP>>>       IO::Handle(1.21)
Net::FTP=GLOB(0x31d28)<<< 220 Secure Gateway FTP server
Net::FTP=GLOB(0x31d28)>>> user anonymous@**.com
Net::FTP=GLOB(0x31d28)<<< 331-Connected to **.com
Net::FTP=GLOB(0x31d28)<<< 331-(vsFTPd 1.2.1)
Net::FTP=GLOB(0x31d28)<<< 331 Please specify the password.
Net::FTP=GLOB(0x31d28)>>> PASS ....
Net::FTP=GLOB(0x31d28)<<< 230 Login successful.
Net::FTP=GLOB(0x31d28)>>> TYPE A
Net::FTP=GLOB(0x31d28)<<< 200 Switching to ASCII mode.
Net::FTP=GLOB(0x31d28)>>> CWD pub/incoming
Net::FTP=GLOB(0x31d28)<<< 250 Directory successfully changed.
Net::FTP=GLOB(0x31d28)>>> PORT 69,52,99,54,135,100
Net::FTP=GLOB(0x31d28)<<< 200 PORT command successful. Consider using
PASV.
Net::FTP=GLOB(0x31d28)>>> NLST
Net::FTP=GLOB(0x31d28)<<< 150 Here comes the directory listing.
Net::FTP=GLOB(0x31d28)<<< 226 Directory send OK.
Net::FTP=GLOB(0x31d28)>>> ALLO 6
Net::FTP=GLOB(0x31d28)<<< 202 ALLO command ignored.
Net::FTP=GLOB(0x31d28)>>> PORT 69,52,99,54,135,101
Net::FTP=GLOB(0x31d28)<<< 530 Bad command sequence
ERROR! Unable to ftp the file at this time: Bad command sequence

Noting the recommendation for Passive mode, I tried that with the same
result.

Thanks for your help.

-mouli.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
l v  
View profile  
 More options Apr 19 2006, 9:10 pm
Newsgroups: comp.lang.perl.misc
From: "l v" <veatc...@yahoo.com>
Date: 19 Apr 2006 18:10:29 -0700
Local: Wed, Apr 19 2006 9:10 pm
Subject: Re: Net::FTP error on put: Bad command sequence

I'm betting that the file name in $outfile is causing the problem.
Meaning it contains some characters which the ftp server does not like.

What is the exact contents of $outfile which cause the error?
What is in the ftp logs?

Len


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »