Merge commit '874f464a2b51000920e2323f93bea116546e9b88' into 7.1.5
Conflicts: src/Umbraco.Core/IO/FileSystemExtensions.cs src/Umbraco.Core/IO/UmbracoMediaFile.cs src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs
This commit is contained in:
@@ -90,10 +90,16 @@ namespace Umbraco.Core.IO
|
||||
|
||||
public void AddFile(string path, Stream stream, bool overrideIfExists)
|
||||
{
|
||||
if (FileExists(path) && !overrideIfExists) throw new InvalidOperationException(string.Format("A file at path '{0}' already exists", path));
|
||||
|
||||
var exists = FileExists(path);
|
||||
if (exists && overrideIfExists == false) throw new InvalidOperationException(string.Format("A file at path '{0}' already exists", path));
|
||||
|
||||
EnsureDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
if (exists)
|
||||
{
|
||||
DeleteFile(path);
|
||||
}
|
||||
|
||||
if (stream.CanSeek)
|
||||
stream.Seek(0, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user