diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 40 |
1 files changed, 40 insertions, 0 deletions
| @@ -46,6 +46,11 @@ Note that you can add multiple hosts from which you want to accept API requests. | |||
| 46 | a space. | 46 | a space. |
| 47 | **IMPORTANT:** The default value if the variable is not set is: `Access-Control-Allow-Origin: *` | 47 | **IMPORTANT:** The default value if the variable is not set is: `Access-Control-Allow-Origin: *` |
| 48 | 48 | ||
| 49 | Configure another environment variable: `MAT2_MAX_FILES_BULK_DOWNLOAD=10` | ||
| 50 | |||
| 51 | This specifies the max number of files that can be bulk downloaded using the api. | ||
| 52 | Note: Each file has a max file size of 16mb | ||
| 53 | |||
| 49 | Finally, restart uWSGI and your web server: | 54 | Finally, restart uWSGI and your web server: |
| 50 | 55 | ||
| 51 | ``` | 56 | ``` |
| @@ -149,6 +154,41 @@ The `file` parameter is the base64 encoded file which will be cleaned. | |||
| 149 | ] | 154 | ] |
| 150 | ``` | 155 | ``` |
| 151 | 156 | ||
| 157 | **Endpoint:** `/api/download/bulk` | ||
| 158 | |||
| 159 | This endpoint allows you to bulk download several files | ||
| 160 | which you uploaded beforehand. Note that the `download_list` | ||
| 161 | MUST contain more than two files. The max length is configurable | ||
| 162 | (default is 10). | ||
| 163 | |||
| 164 | **HTTP Verbs:** POST | ||
| 165 | |||
| 166 | **Body:** | ||
| 167 | ```json | ||
| 168 | { | ||
| 169 | "download_list": [ | ||
| 170 | { | ||
| 171 | "file_name": "uploaded_file_name.jpg", | ||
| 172 | "key": "uploaded_file_key" | ||
| 173 | } | ||
| 174 | ] | ||
| 175 | } | ||
| 176 | ``` | ||
| 177 | |||
| 178 | The `file_name` parameter takes the file name from a previously uploaded file. | ||
| 179 | The `key` parameter is the key from a previously uploaded file. | ||
| 180 | |||
| 181 | **Example Response:** | ||
| 182 | ```json | ||
| 183 | { | ||
| 184 | "output_filename": "files.2cd225d5-2d75-44a2-9f26-e120a87e4279.cleaned.zip", | ||
| 185 | "mime": "application/zip", | ||
| 186 | "key": "5ee4cf8821226340d3d5ed16bd2e1b435234a9ad218f282b489a85d116e7a4c4", | ||
| 187 | "meta_after": {}, | ||
| 188 | "download_link": "http://localhost/api/download/5ee4cf8821226340d3d5ed16bd2e1b435234a9ad218f282b489a85d116e7a4c4/files.2cd225d5-2d75-44a2-9f26-e120a87e4279.cleaned.zip" | ||
| 189 | } | ||
| 190 | ``` | ||
| 191 | |||
| 152 | # Docker | 192 | # Docker |
| 153 | There are two Dockerfiles present in this repository. The file called `Dockerfile.development` is used for development | 193 | There are two Dockerfiles present in this repository. The file called `Dockerfile.development` is used for development |
| 154 | and `Dockerfile.production` is used for production deployments. | 194 | and `Dockerfile.production` is used for production deployments. |
