Exemple #1
0
        private void DeleteFile(string root, Core.Model.File file)
        {
            var fileFullPath = Path.Combine(root, $"{file.Path}/{file.RecordId}/images/{file.Name}");

            if (System.IO.File.Exists(fileFullPath))
            {
                System.IO.File.Delete(fileFullPath);
            }
        }
Exemple #2
0
        private void CopyFile(string root, Core.Model.File file)
        {
            var tempFullPath = Path.Combine(root, $"tempFiles/{file.Name}");
            var targetPath   = Path.Combine(root, $"{file.Path}/{file.RecordId}/images/");
            var destFullPath = Path.Combine(targetPath, file.Name);

            if (!Directory.Exists(targetPath))
            {
                Directory.CreateDirectory(targetPath);
            }

            System.IO.File.Copy(tempFullPath, destFullPath, true);
        }