# имя: 'FTP uploader 2' # описание: перенос файлов на FTP # тип триггера: 'EgsScheduled' # создан: 2017.11.08 11.34.29, Сельченков Н.Ю. # изменен: '2018.04.17 17.56.14', Сельченков Н.Ю. # подробности: https://redmine.integra-s.com:11000/projects/eilyacuario/wiki/FTP_uploader_2 use System.Net.NetworkCredential use System.Net.WebClient use System.IO.Path use System.IO.Directory use System.IO.File use typedef ` ` as Settings const settings = Settings(trigger.settings) let locked(file as string) = try File.OpenWrite(file).Close(); false else true let files = from Directory.GetFiles(settings.local_path) where it isnt locked to array if files isnt empty then let webclient = WebClient() webclient.Credentials = NetworkCredential(settings.ftp_username, settings.ftp_password) from files do let target = settings.ftp_path + "/" + Path.GetFileName(it) webclient.UploadFile(target, "STOR", it) File.Delete(it) now webclient.Dispose() end