mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Bug #17337: Wrong prompt "New file name <MediaFolderName> is not allowed" when rename uploaded media name.(e13a33b2f7fb)
--HG-- branch : dev
This commit is contained in:
@@ -281,7 +281,7 @@ namespace Orchard.Media.Controllers {
|
|||||||
|
|
||||||
// Rename
|
// Rename
|
||||||
if (!String.Equals(viewModel.Name, input["NewName"], StringComparison.OrdinalIgnoreCase)) {
|
if (!String.Equals(viewModel.Name, input["NewName"], StringComparison.OrdinalIgnoreCase)) {
|
||||||
_mediaService.RenameFile(viewModel.Name, input["NewName"], viewModel.MediaPath);
|
_mediaService.RenameFile(viewModel.MediaPath, viewModel.Name, input["NewName"]);
|
||||||
viewModelName = input["NewName"];
|
viewModelName = input["NewName"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -143,7 +143,7 @@ namespace Orchard.Media.Services {
|
|||||||
throw new ArgumentException(T("New file name {0} is not allowed", newFileName).ToString());
|
throw new ArgumentException(T("New file name {0} is not allowed", newFileName).ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
_storageProvider.RenameFile(_storageProvider.Combine(folderPath, currentFileName), _storageProvider.Combine(Path.GetDirectoryName(folderPath), newFileName));
|
_storageProvider.RenameFile(_storageProvider.Combine(folderPath, currentFileName), _storageProvider.Combine(folderPath, newFileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Reference in New Issue
Block a user