Comparison

mod_http_upload/mod_http_upload.lua @ 2474:173fe999cc37

mod_http_upload: Use the correct variable name for directory
author Kim Alvefur <zash@zash.se>
date Sun, 29 Jan 2017 18:10:06 +0100
parent 2472:595d6a25bd7a
child 2475:54c42b097984
comparison
equal deleted inserted replaced
2473:fa8fe2ab332f 2474:173fe999cc37
122 if #event.request.body > file_size_limit then 122 if #event.request.body > file_size_limit then
123 module:log("warn", "Uploaded file too large %d bytes", #event.request.body); 123 module:log("warn", "Uploaded file too large %d bytes", #event.request.body);
124 return 400; 124 return 400;
125 end 125 end
126 pending_slots[path] = nil; 126 pending_slots[path] = nil;
127 local full_filename = join_path(dirname, filename); 127 local full_filename = join_path(random, filename);
128 if lfs.attributes(full_filename) then 128 if lfs.attributes(full_filename) then
129 module:log("warn", "File %s exists already, not replacing it", full_filename); 129 module:log("warn", "File %s exists already, not replacing it", full_filename);
130 return 409; 130 return 409;
131 end 131 end
132 local fh, ferr = io.open(full_filename, "w"); 132 local fh, ferr = io.open(full_filename, "w");