This module implements XEP-0363, versions 0.2 and 0.3, which let clients upload files over HTTP.
mod_http_upload relies on Prosodys HTTP server and mod_http for serving HTTP requests. See Prosodys HTTP server documentation for information about how to configure ports, HTTP Host names etc.
The module can be added as a new Component definition:
"upload.example.org" "http_upload" Component
It should not be added to modules_enabled.
Prosody makes subdomains of your VirtualHosts easily discoverable by
clients. To make the component discoverable by other hosts where the
component is not a subdomain of the VirtualHost, you
can use disco_items
.
"foo.example.org"
VirtualHost = {
disco_items { "upload.example.com" },
}
You may want to give upload access to additional entities such as
components by using the http_upload_access
config
option.
= {"gateway.example.com"}; http_upload_access
A maximum file size can be set by:
= 123 -- bytes http_upload_file_size_limit
Default is 1MB (1024*1024).
This can not be set over the value of
http_max_content_size
(default 10M). Consider mod_http_upload_external
instead of attempting to increase this limit.
Files can be set to be deleted after some time:
= 60 * 60 * 24 * 7 -- a week in seconds http_upload_expire_after
Expired files are deleted when a new upload slot is requested,
A command exists to invoke expiry:
prosodyctl mod_http_upload expire [list of users or hosts]
A total maximum size of all uploaded files per user can be set by:
= 1234 -- bytes http_upload_quota
A request for a slot that would take an user over quota is denied.
By default, uploaded files are put in a sub-directory of the default
Prosody storage path (usually /var/lib/prosody
). This can
be changed:
= "/path/to/uploaded/files" http_upload_path
Works with Prosody 0.11.x and later.
In Prosody 0.12 and later, consider switching to mod_http_file_share which is distributed with Prosody. You can migrate existing files using mod_migrate_http_upload.
With the plugin installer in Prosody 0.12 you can use:
sudo prosodyctl install --server=https://modules.prosody.im/rocks/ mod_http_upload
For earlier versions see the documentation for installing 3rd party modules