By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,251 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,251 IT Pros & Developers. It's quick & easy.

FTP get method

P: 36
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
Apr 8 '08 #1
Share this Question
Share on Google+
6 Replies


KevinADC
Expert 2.5K+
P: 4,059
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.
Apr 8 '08 #2

numberwhun
Expert Mod 2.5K+
P: 3,503
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
Apr 8 '08 #3

P: 36
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
Apr 8 '08 #4

P: 36
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
Apr 9 '08 #5

numberwhun
Expert Mod 2.5K+
P: 3,503
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
Apr 9 '08 #6

KevinADC
Expert 2.5K+
P: 4,059
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.
Apr 9 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.