Jump to content
Sign in to follow this  
Matthy

FTP: downloading a file to your own pc

Recommended Posts

Matthy

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

Share this post


Link to post
Share on other sites
Matthy

omg i think i already have it using fileget sorry to bother.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.