mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Update of code when media folder not exist a media directory is created. If this fails exceptions is trown.
This commit is contained in:
@@ -28,7 +28,12 @@ namespace Orchard.Storage {
|
||||
|
||||
public IEnumerable<IStorageFolder> ListFolders(string path) {
|
||||
if (!Directory.Exists(path)) {
|
||||
throw new ArgumentException("Directory " + path + " does not exist");
|
||||
try {
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}",path,ex));
|
||||
}
|
||||
}
|
||||
|
||||
return new DirectoryInfo(path)
|
||||
|
Reference in New Issue
Block a user