changeset 1967:2ce2b194d501

mod_http_upload: Make file system path configurable
author Kim Alvefur <zash@zash.se>
date Fri, 11 Dec 2015 18:20:14 +0100
parents 3b748666ff97
children 95ad6e68e203
files mod_http_upload/README.markdown mod_http_upload/mod_http_upload.lua
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_upload/README.markdown	Fri Dec 11 18:00:43 2015 +0100
+++ b/mod_http_upload/README.markdown	Fri Dec 11 18:20:14 2015 +0100
@@ -58,6 +58,16 @@
 http_upload_file_size_limit = 10 * 1024 * 1024 -- this is 10MB in bytes
 ```
 
+Path
+----
+
+By default, uploaded files are put in a sub-directory of the default
+Prosody storage path (usually `/var/lib/prosody`). This can be changed:
+
+``` {.lua}
+http_upload_path = "/path/to/uploded/files"
+```
+
 Compatibility
 =============
 
--- a/mod_http_upload/mod_http_upload.lua	Fri Dec 11 18:00:43 2015 +0100
+++ b/mod_http_upload/mod_http_upload.lua	Fri Dec 11 18:20:14 2015 +0100
@@ -35,7 +35,7 @@
 -- state
 local pending_slots = module:shared("upload_slots");
 
-local storage_path = join_path(prosody.paths.data, module.name);
+local storage_path = module:get_option_string(module.name .. "_path", join_path(prosody.paths.data, module.name));
 lfs.mkdir(storage_path);
 
 -- hooks