hover animation preload hover animation preload hover animation preload
wordpress post entry title background
FTPplanet.com forums
post entry title background

File Transfer Planet Forums » FTP Help and Tips

error simulating an ftp client

(1 post)
  • Started 1 year ago by aryan98876
  • This topic is not resolved

Tags:

  1. aryan98876
    Member

    i am using array to store a command given at run time by user... and execute it.....but after a connection is made to any ftp sites only 'ls' or 'dir' commands work....and if i wish to change directory or get any file or put file.example
    get("123.mp3")
    put("abc.txt")
    cd user
    etc or any commands that has space in between
    then it gives error.wat i cn do to get or put files ...

    #!/usr/bin/perl

    use Net::FTP;

    print("\nHost\/IP: ");
    $host = <STDIN>;
    chomp ($host);

    print("\nUsername: ");
    $username = <STDIN>;
    chomp ($username);
    print "Password: ";
    chop ($password = <STDIN>);
    stty echo;
    print "\n";

    print("Connecting to $host...\n");
    my $ftp = Net::FTP->new($host) or die "Couldn't connect to $host\n";
    print("Connected!\n");
    print("\nFTP>");

    $ftp->login($username, $password)
    or die "Could not log in .\n";

    rep:

    $command = <STDIN>;

    chomp ($command);

    unless ("$command" eq "bye") {

    @listing = $ftp->$command;

    for($i=0;$i<@listing;$i++) { print "$listing[$i]\n"; }

    print("FTP>");

    goto rep;

    }

    Posted 1 year ago #

RSS feed for this topic

Reply

(required)

Allowed markup: a blockquote code em strong ul ol li img.
You can also put code in between backtick ( ` ) characters.


Fatal error: Call to undefined function mini_stats() in /home/ftplanetipswitch/filetransferplanet.com/forums/my-templates/flapkakumei/footer.php on line 19