Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 2478:1fae2a0a4092
mod_http_upload: Fix to include base storage path
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 29 Jan 2017 19:27:27 +0100 |
| parents | c32ca5ad2539 |
| children | a440f0514c2a |
comparison
equal
deleted
inserted
replaced
| 2477:c32ca5ad2539 | 2478:1fae2a0a4092 |
|---|---|
| 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(random, filename); | 127 local full_filename = join_path(storage_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"); |
