Jump to content

FTP: downloading a file to your own pc


Recommended Posts

hi i recently found the ftp function on autoit and still try to get the hang on it i am trying to make a backupdownloader that downloads a cronjob backup from the ftp and then sets it on my computer.

this is what i have for so far

$ftp = _FTP_Open("myFtp")
$connection = _FTP_Connect($ftp,$server,$user,$password)

Local $h_Handle
$aFile = _FTP_FindFileFirst($connection, $backupDir, $h_Handle)
$aFile = _FTP_FindFileNext($h_Handle)
$aFile = _FTP_FindFileNext($h_Handle) ; need to have the 3rd file in the directory why i dont know but now it gives the rigth filename
ConsoleWrite('$FilenameNext1 = ' & $aFile[10] & ' attribute = ' & $aFile[1] & '  -> Error code: ' & @error & @crlf)

$fileDir = $backupDir & $aFile[10]
ConsoleWrite($fileDir)

i have seen UDF's like

_FTP_FileOpen

_FTP_FileRead

_FTP_FileGet

but i dont know how to use them and which one (to bad it doesnt have a exaple on the help file and tells whats the difference between these 3 is). i am talking about a file of 30 megs or more so i dont think you can that easily put it in a varable.

anyone a idea?

Thanks

Matthy

Edited by Matthy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...