Jump to content

toofat

Active Members
  • Posts

    42
  • Joined

  • Last visited

Community Answers

  1. toofat's post in FTPEx problem was marked as the answer   
    OK got it
    #include <FTPEx.au3> $sServer = 'ftp.myfirm.com' $sUsername = 'UserLogin' $sPass = 'UserPass' $hOpen = _FTP_Open ('FTP Control') $hConnect = _FTP_Connect ($hOpen, $sServer, $sUsername, $sPass, 1) _FTP_DirSetCurrent ($hConnect, '/Dir1/Dir2') While 'FTP Connection' Dim $h_Handle $aFile = _FTP_FindFileFirst ($hConnect, '/Dir1/Dir2/', $h_Handle, $INTERNET_FLAG_NO_CACHE_WRITE) If NOT @error Then While 'FTP Download/Delete' Sleep (10) ConsoleWrite ('File found: ' & $aFile[10] & @CRLF) _FTP_FileGet ($hConnect, '/Dir1/Dir2/' & $aFile[10], 'D:\FTPtarget\' & $aFile[10], False, 0, $INTERNET_FLAG_RELOAD) If NOT @error Then ConsoleWrite ('Downloaded file ' & $aFile[10] & @CRLF) _FTP_FileDelete ($hConnect, '/Dir1/Dir2/' & $aFile[10]) If NOT @error Then ConsoleWrite ('Deleted file' & @CRLF) EndIf $aFile = _FTP_FindFileNext ($h_Handle) If @error Then ExitLoop WEnd EndIf $aClose = _FTP_FindFileClose ($h_Handle) ConsoleWrite ('Waiting 10s' & @CRLF & @CRLF) Sleep (10000) WEnd $hDisconnect = _FTP_Close ($hConnect) $hClose = _FTP_Close ($hOpen) Exit Added two flags:
    1. $INTERNET_FLAG_NO_CACHE_WRITE to "_FTP_FindFileFirst"
    2. $INTERNET_FLAG_RELOAD to "_FTP_FileGet"
    I should have read the help file better ...
×
×
  • Create New...