FTP get method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jain236
    New Member
    • Jul 2007
    • 36

    FTP get method

    Hi all

    i am trying to copy file using FTP, when i am trying to copy it is copying to folder where i am running the script , instead of this i want to copy the file in anohter pc (not mine, not where i FTP,)

    i am using the following code

    #$ftp->get($name, '172.24.185.90/Builds/') or warn "Could not get $_, skipped: $!";

    but here i am getting error that direcotry does not exists

    your help we be apprecitated
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Your question is not easy to understand.

    You have a perl script on your computer and it is FTPing to another computer and you want to send the file to a third computer? I don't think you can do that. FTP is bidirectional, from computer A to computer B. You can't direct the file transfer to computer C, at least not that I know of.

    Comment

    • numberwhun
      Recognized Expert Moderator Specialist
      • May 2007
      • 3467

      #3
      Originally posted by KevinADC
      Your question is not easy to understand.

      You have a perl script on your computer and it is FTPing to another computer and you want to send the file to a third computer? I don't think you can do that. FTP is bidirectional, from computer A to computer B. You can't direct the file transfer to computer C, at least not that I know of.
      I have to whole heartedly agree with Kevin. What you are trying to do is not possible, directly. Instead, you will have to use your PC as the "go-between". In other words, you will have to download the file from its present host to your machine, then do another FTP and put the file to its destination PC. Direct transfer between those other two machines would only work if your script was sitting on one of them, and running there.

      Regards,

      Jeff

      Comment

      • jain236
        New Member
        • Jul 2007
        • 36

        #4
        Originally posted by KevinADC
        Your question is not easy to understand.

        You have a perl script on your computer and it is FTPing to another computer and you want to send the file to a third computer? I don't think you can do that. FTP is bidirectional, from computer A to computer B. You can't direct the file transfer to computer C, at least not that I know of.
        hI KEVIN
        you got exactly to my heart.. thats what i wanted to do.. and you cleared my doubt...

        thanks for your help

        Comment

        • jain236
          New Member
          • Jul 2007
          • 36

          #5
          Originally posted by jain236
          hI KEVIN
          you got exactly to my heart.. thats what i wanted to do.. and you cleared my doubt...

          thanks for your help
          Hi kevin

          i have one more question

          can i get the file in different location(other than the directory where my script is running)in my pc
          i mean to say, i am FTP to one pc and by using get method i am copying file to my pc but i want to copy file in the D directory where as my script is C directory

          your help will be appreciated

          Comment

          • numberwhun
            Recognized Expert Moderator Specialist
            • May 2007
            • 3467

            #6
            Originally posted by jain236
            Hi kevin

            i have one more question

            can i get the file in different location(other than the directory where my script is running)in my pc
            i mean to say, i am FTP to one pc and by using get method i am copying file to my pc but i want to copy file in the D directory where as my script is C directory

            your help will be appreciated
            I suggest that you read up on the basic FTP commands.

            You are connected to the other machine using FTP and are using the"get" method to retrieve the file. Before you issue the get, you would have to issue the "lcd" command to change the directory on your local machine.

            Regards,

            Jeff

            Comment

            • KevinADC
              Recognized Expert Specialist
              • Jan 2007
              • 4092

              #7
              Yes, as Jeff suggests, read the manual or documentation for the module you are using (Net::FTP?) It will show you the available commands like cd and other related information.

              Comment

              Working...