RE: ftp w/o using Net::FTP

James P Donnelly <jpd4@cisunix.unh.edu> asked:
> I am only trying to login into a server, travese to the 
> correct directory, dump a file and quit.  I have hacked 
> together something that gets me to the server and
> then it seems to hang at the login..   Has anyone written 
> something like 
> this w/o use of the module?  Any insight would be very helpful
> 
> Thanks -- Jim
> 
> 
> $cmd = 'rftp';
> $rftp_commands =
>                 "open
>                  $fHost
>                  $user
>                  $pass
>                  quit
> ";
> 
>   open(CMD,"|$cmd");
>   print CMD $rftp_commands;
>   close(CMD);

The way it looks you're trying to ram a whole set of commands
down the FTP server's throat at once. No wonder it's choking.

What you should do is use IPC::Open2 so that you're able to
read the output from the FTP program. Then you can script your
way through the process, sending commands only when the client
is prompting for them.

See the perlipc manpage for more info on IPC::Open2.


HTH,
Thomas
0
t
10/28/2004 7:26:32 AM
perl.beginners 29388 articles. 4 followers. Follow

0 Replies
650 Views

Similar Articles

[PageSpeed] 56

Reply:

Similar Artilces:

Re: [MacPerl] Re: using Net::FTP
--- Bart Lateur wrote: >I figured out my problem. It works with $ftp->ls(). Default is the current >directory. I still don't know why the $ftp->ls("webshare:available:") doesn't >work. By the look of it, I would think that FTP would follow the Unix convention for file paths. So, use "/" not ":" as file path separator. I guess. -- Bart. --- end of quote --- Great idea. I just tried, and it didn't work. Too bad. Should have worked. Thanks, Kathy ...

automatic FTP not using NET:FTP module
Hi, I have to automate ftp process using perl or shell scripts. At the moment I cannot install NET:FTP class. So any pointers for me on how do this. thanks, vas _______________________________________________________ Send a cool gift with your E-Card http://www.bluemountain.com/giftcenter/ On Wed, Jul 11, 2001 at 10:20:58AM -0700, srinivas.s@excite.com wrote: > I have to automate ftp process using perl or shell scripts. At the moment I > cannot install NET:FTP class. So any pointers for me on how do this. Why can't you install Net::FTP? Really, it&#...

FTP not using NET:FTP module ... Why dose this work???
Hi Using Luke Bakkens reply >If you can't install Net::FTP, the following works with the ftp.exe >program on NT to get the file /tmp/frazzle in binary mode: > >open FTP, "> tmpftp.$$"; >print FTP <<EOF; >$username >$password >bin >get /tmp/frazzle >bye >EOF >close FTP >system "ftp -s:tmpftp.$$ $hostname"; >unlink tmpftp.$$ > >on unix, the system call would be this i believe: >system "ftp $hostname < tmpftp.$$"; > >good luck >Luke I went and did the following, but ...

FTP to FTP
Lately I've been seeing scans show up of a port 21 trying to connect to my port 21 (I am not, BTW, running an FTP server). Is this just someone trying to use my IP as the middleman in an FTP bounce attack, assuming my port 21 had been open and with a writeable FTP directory? http://www.cert.org/advisories/CA-1997-27.html ...

Re: Re: Net::ftp
b3IgY29uc2lkZXIgdG8gdXNlIHJzeW5jIHRvb2wsIHRoYXQncyBzaW1wbGUgYW5kIGVmZmVjdGl2 ZSBlbm91Z2guDQoNCg0KLS0tLS0gT3JpZ2luYWwgTWVzc2FnZSAtLS0tLQ0KRnJvbTogRGVybW90 IA0KVG86IGR2ZEBkdmRtYWduZXQuY29tDQpTdWJqZWN0OiBSZTogTmV0OjpmdHANCkRhdGU6IDIw MDgtMTEtMiAwNTo0NTozMg0KDQoyMDA4LzExLzEgZHZkQGR2ZG1hZ25ldC5jb20gOg0KDQpZb3Ug bmVhcmx5IGhhZCBpbi4gSSB0aGluayB5b3UgYXNzdW1lZCB0aGF0IHlvdSBjb3VsZCBjb3B5IGEg ZGlyZWN0b3J5DQoNCmFuZCBpdCdzIGZpbGVzIGluIG9uZSBoaXQgYnV0IHRoYXQgbm90IHBvc3Np YmxlIHdpdGggTmV0OjpGVFANCg0KCgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCtDCwMu/1b...

RE: Re[2]: Net::ftp
It is part of libnet and usually installed as part of core Perl install. Wags ;) -----Original Message----- From: Tim Musson [mailto:Tim@Musson.net] Sent: Monday, July 09, 2001 16:09 To: beginners@perl.org Subject: Re[2]: Net::ftp Hey Jorge, Monday, July 09, 2001, 5:36:33 AM, my MUA believes you used dtmail 1.3.0 @(#)CDE Version 1.4.2 SunOS 5.8 sun4u sparc to write: JG> Hi How I can install Net::ftp I try with ppm but I didn't find it JG> when I type search,I am under windows 98 and I wanted to install JG> a ftp client. What did you type? btw, I t...

Re: Upload Files to FTP Enabled Machine using ASP.NET 2.0
Hi, i would like to create a web application in C#.Net 2005 for uploading files to remote machine from local machine through FTP. if anyone knows, please send that code. please it is very urgent.  Google is your friend:  a quick search for "C# FTP Applications" yields this great page! http://www.example-code.com/csharp/ftp.asp hope this helps,mcm ...

Anyone have Cute FTP or use an ftp
I need tips on how to connect my computer to my buddies via FTP. We want to down load from each others computer, but it wont allow us to connect ??. any and ALL help or howto guides/links welcome. Ian >I need tips on how to connect my computer to my buddies via FTP. We want to >down load from each others computer, but it wont allow us to connect ??. any >and ALL help or howto guides/links welcome. For starters, you will both need FTP servers. CuteFTP is a FTP client, not a server. It's the FTP equivalent of a browser. For two way transfers, you will need both servers...

VB.NET
All, This is probably a much harder question than what should go in the "Getting Started" forum, but I am new and don't know where to put it. Anyways, I am currently developing an FTP class in VB.NET. It's kid tested, mother approved when trying to access an FTP Server on a Windows box meaning I can connect, run commands, upload and download a file no problem. My issues come when I try to use the same class with the same commands to access an FTP server on a UNIX box. I can connect and login just fine, but after that all my commands come back "500 'PWD': command not understood.". This is fo...

ftp folder using asp.net(vb.net)
 can i ftp a folder to a server using asp.net? anyone? thanks  Yes, you can use one of the Ftp components available, or just use the WebClient classhttp://www.windowsdevcenter.com/pub/a/windows/2006/12/12/building-ftp-services-using-net-20.html -- "Mark As Answer" if my reply helped you -- Yes, you can do it.  You actually just grab all the files out of the folder and send them up. See this: http://forums.asp.net/p/1288676/2483713.aspx Jason...

using Net::FTP
I can get and put a file using Net::FTP if I know the name of the file. I need to be able to open a directory and get all the files in it, without knowing their names. Here is my code that 'almost' works. $ftp->cwd("webshare:available:") or die "Can't cwd to webshare:available:"; my @items = $ftp->ls("webshare:available:"); foreach my $f(@items) { print "This file is named " . $f; print "\n"; $ftp->get($f) or die "Can't get file."; } There are 2 files in the available direct...

RE:Net::ftp
Hi How I can install Net::ftp I try with ppm but I didn't find it when I type search,I am under windows 98 and I wanted to install a ftp client. Thanks Hey Jorge, Monday, July 09, 2001, 5:36:33 AM, my MUA believes you used dtmail 1.3.0 @(#)CDE Version 1.4.2 SunOS 5.8 sun4u sparc to write: JG> Hi How I can install Net::ftp I try with ppm but I didn't find it JG> when I type search,I am under windows 98 and I wanted to install JG> a ftp client. What did you type? btw, I think it may be part of the libnet modules... It also might already be installed ...

FTP a file to a FTP server with .NET code
    Hi,I want my web app to be able to upload a user submitted file via FTP to another server.  I'm checking out components and they seem way out of price range for me ($399+)  Isn't there some simple source code in .NET available ?   Or maybe somebody knows a good, reliable, cheaper component ?Any help much appreciatedthanks,mike123 See the Google search results for c# ftp upload, more specifically http://www.csharphelp.com/archives/archive9.html. RyanRyan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question   ...

How to upload large files through FTP using Asp.net and VB.net
Hi, I want you to tell me that how can i upload the large files through FTP using asp.net and vb.net. I have developed a page where user can upload his/her file which is about 1-5 mb but if file size increase upto 50 mb then my page do not work. If i try so, then find the following error: The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log o...

Web resources about - RE: ftp w/o using Net::FTP - perl.beginners

Resources last updated: 12/1/2015 8:20:33 AM