mod_http_upload/mod_http_upload.lua
changeset 3652 aa12b95a6d36
parent 3629 a578b4977bb0
child 3653 d252c8573f33
equal deleted inserted replaced
3651:a0ca5d0a49ba 3652:aa12b95a6d36
    91 module:add_feature(legacy_namespace);
    91 module:add_feature(legacy_namespace);
    92 
    92 
    93 module:add_extension(dataform {
    93 module:add_extension(dataform {
    94 	{ name = "FORM_TYPE", type = "hidden", value = namespace },
    94 	{ name = "FORM_TYPE", type = "hidden", value = namespace },
    95 	{ name = "max-file-size", type = "text-single" },
    95 	{ name = "max-file-size", type = "text-single" },
    96 }:form({ ["max-file-size"] = tostring(file_size_limit) }, "result"));
    96 }:form({ ["max-file-size"] = ("%d"):format(file_size_limit) }, "result"));
    97 
    97 
    98 module:add_extension(dataform {
    98 module:add_extension(dataform {
    99 	{ name = "FORM_TYPE", type = "hidden", value = legacy_namespace },
    99 	{ name = "FORM_TYPE", type = "hidden", value = legacy_namespace },
   100 	{ name = "max-file-size", type = "text-single" },
   100 	{ name = "max-file-size", type = "text-single" },
   101 }:form({ ["max-file-size"] = tostring(file_size_limit) }, "result"));
   101 }:form({ ["max-file-size"] = ("%d"):format(file_size_limit) }, "result"));
   102 
   102 
   103 -- state
   103 -- state
   104 local pending_slots = module:shared("upload_slots");
   104 local pending_slots = module:shared("upload_slots");
   105 
   105 
   106 local storage_path = module:get_option_string(module.name .. "_path", join_path(prosody.paths.data, module.name));
   106 local storage_path = module:get_option_string(module.name .. "_path", join_path(prosody.paths.data, module.name));