mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
#17387: Failure to save media from a zip file with directory structure that corresponds to a directory in tenant media folder that does not exist yet.
--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