示例#1
0
        private void _directoryWatcher_Created(object sender, FileSystemEventArgs e)
        {
            _fileSender.SendFile(e.Name, e.FullPath);

            FileHelper.WaitForFileToUnlock(e.FullPath);
            File.Delete(e.FullPath);
        }
        public ActionResult SendFile(string source)
        {
            try
            {
                Logger.LogInformation($"FtpProxy.SendFile Called for: {source}");

                source.CheckNullOrEmpty(nameof(source));

                Sender.SendFile(source);

                return(Ok("Success"));
            }
            catch (Exception except)
            {
                Logger.LogError(except, $"Error sending file {source}");
                return(BadRequest(except.ToString()));
            }
        }