Diff

mod_http_upload/mod_http_upload.lua @ 2732:b1c5b0c369c2

mod_http_upload: Remove directory when deleting a file (fixes #950)
author Kim Alvefur <zash@zash.se>
date Thu, 27 Jul 2017 16:46:18 +0200
parent 2731:d48faff92490
child 2738:46b29a377bdf
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua	Sat Jul 22 23:14:13 2017 +0200
+++ b/mod_http_upload/mod_http_upload.lua	Thu Jul 27 16:46:18 2017 +0200
@@ -88,6 +88,7 @@
 			if not deleted then
 				module:log("warn", "Could not delete expired upload %s: %s", filename, whynot or "delete failed");
 			end
+			os.remove(filename:match("^(.*)[/\\]"));
 			return false;
 		elseif item.time < upload_window and not lfs.attributes(filename) then
 			return false; -- File was not uploaded or has been deleted since