equal
deleted
inserted
replaced
287 local fh, err = io.open(filename.."~", "w"); |
287 local fh, err = io.open(filename.."~", "w"); |
288 if not fh then |
288 if not fh then |
289 module:log("error", "Could not open file for writing: %s", err); |
289 module:log("error", "Could not open file for writing: %s", err); |
290 return 500; |
290 return 500; |
291 end |
291 end |
292 function event.response:on_destroy() |
292 function event.response:on_destroy() -- luacheck: ignore 212/self |
293 -- Clean up incomplete upload |
293 -- Clean up incomplete upload |
294 if io.type(fh) == "file" then -- still open |
294 if io.type(fh) == "file" then -- still open |
295 fh:close(); |
295 fh:close(); |
296 os.remove(filename.."~"); |
296 os.remove(filename.."~"); |
297 end |
297 end |