diff --git a/public/language/en-GB/admin/settings/uploads.json b/public/language/en-GB/admin/settings/uploads.json
index 5ca546848c..078a19ccd2 100644
--- a/public/language/en-GB/admin/settings/uploads.json
+++ b/public/language/en-GB/admin/settings/uploads.json
@@ -5,6 +5,7 @@
"strip-exif-data": "Strip EXIF Data",
"preserve-orphaned-uploads": "Keep uploaded files on disk after a post is purged",
"orphanExpiryDays": "Days to keep orphaned files",
+ "orphanExpiryDays-help": "After this many days, orphaned uploads will be deleted from the file system.
Set 0 or leave blank to disable.",
"private-extensions": "File extensions to make private",
"private-uploads-extensions-help": "Enter comma-separated list of file extensions to make private here (e.g. pdf,xls,doc). An empty list means all files are private.",
"resize-image-width-threshold": "Resize images if they are wider than specified width",
diff --git a/src/file.js b/src/file.js
index 6f1f0ebedd..ff836b05da 100644
--- a/src/file.js
+++ b/src/file.js
@@ -107,6 +107,11 @@ file.delete = async function (path) {
try {
await fs.promises.unlink(path);
} catch (err) {
+ if (err.code === 'ENOENT') {
+ winston.verbose(`[file] Attempted to delete non-existent file: ${path}`);
+ return;
+ }
+
winston.warn(err);
}
};
diff --git a/src/views/admin/settings/uploads.tpl b/src/views/admin/settings/uploads.tpl
index 8cb352c987..820d6943dc 100644
--- a/src/views/admin/settings/uploads.tpl
+++ b/src/views/admin/settings/uploads.tpl
@@ -135,9 +135,10 @@
[[admin/settings/uploads:orphanExpiryDays-help]]