Results 1 to 4 of 4

Thread: perl Net::FTP question

  1. #1
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,785

    perl Net::FTP question

    im kinda new to perl so im probably missing the obvious. the script below seems to work fine, reaches the server, logs in, creats a my.zip on the server but stops before it transfers the data. the file shoud be around 6meg but on the server its 167k

    activeperl on a win2k machine >win2kserver


    use Net::FTP;
    $hostname = 'xxx.xxx.xxx.xxx';
    $username = 'bush';
    $password = 'thenewgod';
    $filermote = 'My.zip';
    $filelocl = 'c:\\transfer\\My.zip';
    $ftp = Net::FTP->new($hostname);
    $ftp->login($username, $password);
    $ftp->put($filelocl, $filermote );
    $ftp->quit;


    does anyone know how to change the mode to binary?
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  2. #2
    I dont know if thats your problem but from the activeperl Net::Ftp docs

    type (TYPE [, ARGS])

    This method will send the TYPE command to the remote FTP server to change the type of data transfer. The return value is the previous value.

  3. #3
    Senior Member roswell1329's Avatar
    Join Date
    Jan 2002
    Posts
    670
    Yup...I found that too, owensleftfoot.

    type (TYPE [, ARGS])
    This method will send the TYPE command to the remote FTP server to change the type of data transfer. The return value is the previous value.

    ascii ([ARGS]) binary([ARGS]) ebcdic([ARGS]) byte([ARGS])
    Here for more info.
    /* You are not expected to understand this. */

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,785
    no the binary issue wasnt the problem that was a question i added on and thanks for the links. it turned out to be 5.6 that was the problem the script works fine with 5.8. every one i spoke to said that cant be the problem, so i uninstalled 5.8 found a different install for 5.6 in case it was the install itself that was causing the problem. the script once again ended before it transfered.

    unfortunatly perl2exe dosn't support 5.8 yet so i have to wait for them to catch up
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •