#include #include #include sleep(500) $server = '192.168.1.253' ;FTP Server $username = 'admin' ;FTP Username $pass = 'scanf1980' ;FTP Password $Lap = 0 While $Lap = 0 sleep(50000) $Open = _FTP_Open('DATA') $Conn = _FTPConnect($Open, $server, $username, $pass,0,1,0x08000000) ;Hard drive source file and server directory (change to suit) Local $aFileList = _FileListToArray("C:\temp", "*") $iMax = UBound($aFileList) For $i = 1 to $iMax - 1; subtract 1 from size to prevent an out of bounds error $File_name = $aFileList[$i] $Ftpp = _FtpPutFile($Conn,"C:/temp/"&$File_name, 'DATA/'&$File_name , 0x08000000) Next Local $iFtpc = _FTP_Close($Open) WEnd Func _FTPConnect($l_InternetSession, $s_ServerName, $s_Username, $s_Password, $i_ServerPort = 0, $l_Service = 1, $l_Flags = 0, $l_Context = 0) Local $ai_InternetConnect = DllCall('wininet.dll', 'long', 'InternetConnect', 'long', $l_InternetSession, 'str', $s_ServerName, 'int', $i_ServerPort, 'str', $s_Username, 'str', $s_Password, 'long', $l_Service, 'long', $l_Flags, 'long', $l_Context) If @error OR $ai_InternetConnect[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_InternetConnect[0] EndFunc Func _FtpPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0) Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'FtpPutFile', 'long', $l_FTPSession, 'str', $s_LocalFile, 'str', $s_RemoteFile, 'long', $l_Flags, 'long', $l_Context) If @error OR $ai_FTPPutFile[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPPutFile[0] EndFunc