private void CopyFile(string path, string newPath) { path = GetRelativePath(path); var file = _fileSystem.GetFile(path); if (!file.Exists) { throw new Exception(LangRes("E_CopyFileInvalisPath")); } try { newPath = _fileSystem.Combine(GetRelativePath(newPath), file.Name); if (_fileSystem.CheckFileUniqueness(newPath, out var newFile)) { newPath = newFile.Path; } _fileSystem.CopyFile(path, newPath); Response.Write(GetResultString()); } catch (Exception ex) { throw new Exception(LangRes("E_CopyFile") + ": " + ex.Message); } }