Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP change get path

Status
Not open for further replies.

csudess

Technical User
Apr 1, 2010
14
HU
I use an ftp server and when i get a file, i would like to change the directory i mean where i wanna to save the file i ve tryed this

$ftp->get("data.txt","data.txt","D:/work/list/data.txt")

but it didnt work, anybody have a solution?

Thank u afurther for ur answer

 
Hi

Are you using the [tt]Net::FTP[/tt] module ? Because to me seems that [tt]get[/tt]'s third parameter has a very different meaning :
Net::FTP | Methods | get said:
get ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] )
If [highlight #eed]WHERE[/highlight] is given then the first [highlight #eed]WHERE[/highlight] bytes of the file will not be transferred, and the remaining bytes will be appended to the local file if it already exists.
I would put your third parameter in place of the second parameter :
Code:
[navy]$ftp[/navy][teal]->[/teal][COLOR=darkgoldenrod]get[/color][teal]([/teal][green][i]"data.txt"[/i][/green][teal],[/teal][green][i]"D:/work/list/data.txt"[/i][/green][teal]);[/teal]

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top