Delete temp document type file if validation fails (#11836)
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
This commit is contained in:
@@ -611,6 +611,8 @@ namespace Umbraco.Web.Editors
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cleanup the temp file
|
||||
System.IO.File.Delete(destFileName);
|
||||
model.Notifications.Add(new Notification(
|
||||
Services.TextService.Localize("speechBubbles", "operationFailedHeader"),
|
||||
Services.TextService.Localize("media", "disallowedFileType"),
|
||||
@@ -619,6 +621,8 @@ namespace Umbraco.Web.Editors
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cleanup the temp file
|
||||
System.IO.File.Delete(result.FileData[0].LocalFileName);
|
||||
model.Notifications.Add(new Notification(
|
||||
Services.TextService.Localize("speechBubbles", "operationFailedHeader"),
|
||||
Services.TextService.Localize("media", "invalidFileName"),
|
||||
|
||||
Reference in New Issue
Block a user