mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -233,6 +233,11 @@ namespace Orchard.FileSystems.Media {
|
||||
throw new ArgumentException(T("File {0} already exists", fileInfo.Name).ToString());
|
||||
}
|
||||
|
||||
// ensure the directory exists
|
||||
var dirName = Path.GetDirectoryName(fileInfo.FullName);
|
||||
if (!Directory.Exists(dirName)) {
|
||||
Directory.CreateDirectory(dirName);
|
||||
}
|
||||
File.WriteAllBytes(fileInfo.FullName, new byte[0]);
|
||||
|
||||
return new FileSystemStorageFile(Fix(path), fileInfo);
|
||||
|
Reference in New Issue
Block a user