comparison mod_http_upload/README.md @ 5975:fe081789f7b5

All community modules: Unify file extention of Markdown files to .md
author Menel <menel@snikket.de>
date Tue, 22 Oct 2024 10:26:01 +0200
parents mod_http_upload/README.markdown@694b62d8a82f
children 37c77676303b
comparison
equal deleted inserted replaced
5974:5a65a632d5b9 5975:fe081789f7b5
1 ---
2 description: HTTP File Upload
3 labels:
4 - Stage-Alpha
5 ---
6
7 Introduction
8 ============
9
10 This module implements [XEP-0363], versions 0.2 and 0.3, which let
11 clients upload files over HTTP.
12
13 Configuration
14 =============
15
16 mod\_http\_upload relies on Prosodys HTTP server and mod\_http for
17 serving HTTP requests. See [Prosodys HTTP server documentation][doc:http]
18 for information about how to configure ports, HTTP Host names etc.
19
20 The module can be added as a new Component definition:
21
22 ``` {.lua}
23 Component "upload.example.org" "http_upload"
24 ```
25
26 It should **not** be added to modules_enabled.
27
28 ## Discoverability
29
30 Prosody makes subdomains of your VirtualHosts easily discoverable by
31 clients. To make the component discoverable by other hosts where the
32 component is **not a subdomain** of the VirtualHost, you can use
33 [`disco_items`][doc:modules:mod_disco#configuration].
34
35 ``` {.lua}
36 VirtualHost "foo.example.org"
37 disco_items = {
38 { "upload.example.com" },
39 }
40 ```
41
42 ## Access
43
44 You may want to give upload access to additional entities such as components
45 by using the `http_upload_access` config option.
46
47 ``` {.lua}
48 http_upload_access = {"gateway.example.com"};
49 ```
50
51 Limits
52 ------
53
54 ### Max size
55
56 A maximum file size can be set by:
57
58 ``` {.lua}
59 http_upload_file_size_limit = 123 -- bytes
60 ```
61
62 Default is 1MB (1024\*1024).
63
64 This can not be set over the value of `http_max_content_size` (default 10M).
65 Consider [mod_http_upload_external] instead of attempting to increase
66 this limit.
67
68 ### Max age
69
70 Files can be set to be deleted after some time:
71
72 ``` lua
73 http_upload_expire_after = 60 * 60 * 24 * 7 -- a week in seconds
74 ```
75
76 Expired files are deleted when a new upload slot is requested,
77
78 A command exists to invoke expiry:
79
80 ```
81 prosodyctl mod_http_upload expire [list of users or hosts]
82 ```
83
84 ### User quota
85
86 A total maximum size of all uploaded files per user can be set by:
87
88 ``` lua
89 http_upload_quota = 1234 -- bytes
90 ```
91
92 A request for a slot that would take an user over quota is denied.
93
94 Path
95 ----
96
97 By default, uploaded files are put in a sub-directory of the default
98 Prosody storage path (usually `/var/lib/prosody`). This can be changed:
99
100 ``` {.lua}
101 http_upload_path = "/path/to/uploaded/files"
102 ```
103
104 Compatibility
105 =============
106
107 Works with Prosody 0.11.x and later.
108
109 In Prosody 0.12 and later, consider switching to [mod_http_file_share](https://prosody.im/doc/modules/mod_http_file_share)
110 which is distributed with Prosody. You can migrate existing files using
111 [mod_migrate_http_upload](https://modules.prosody.im/mod_migrate_http_upload.html).