Je vous pris de m’aider à compléter le scripte ci-dessous.
Je cherche :
1- A télécharger plusieurs fichiers sur mon FTP, mais un par un suivant la date inscrite sur chaque fichier.
2- Supprimer le fichier déjà téléchargé (1).
Merci
Code : Tout sélectionner
#include <Process.au3>
#include <FTPEx.au3>
;=====================================
Execut01()
Func Execut01()
Dim $appli1= ImportFileInFtp()
Dim $appli2= SuppFileFtp()
If Not IsAdmin() Then
RunAsWait( $appli1,$appli2, "", 0, @ScriptFullPath, @ScriptDir)
EndIf
EndFunc
;========================================
Func ImportFileInFtp()
Local $UrlFtp = "http://Boulanza.com"
Local $sourceFtp = "/test/mesfichiers/"
$test= _RunDos('wget -r -l 1 -A.ini "'&$UrlFtp&""&$sourceFtp &'"')
EndFunc
;========================================
Func SuppFileFtp()
$ftp_server = "xxx"
$ftp_username = "xxxx"
$ftp_password = "xxxx"
$ftpfolder = "test/mesfichiers"
Local $ftp_session
Local $h_Handle
$ftp_session = _FTP_Open("$ftp_session ")
;MsgBox(0, "Fichier:", $ftp_session)
$ftp_CS = _FTP_Connect($ftp_session, $ftp_server, $ftp_username, $ftp_password)
$nonhtm = _FTP_FindFileFirst ( $ftp_CS, $ftpfolder & "/*.*", $h_Handle )
While 1
$nonhtm = _FTP_FindFileNext ( $h_Handle )
If Not @error Then
If StringLen($nonhtm[10]) > 2 AND StringRight ( $nonhtm[10] , 4 ) <> ".*" Then
_FTP_FileDelete ( $ftp_CS, "/" & $ftpfolder & "/" & $nonhtm[10] )
EndIf
Else
ExitLoop
EndIf
WEnd
EndFunc
;==================================


