diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/civetweb/docs/api/mg_send_mime_file2.md | |
parent | Initial commit. (diff) | |
download | ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/civetweb/docs/api/mg_send_mime_file2.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/civetweb/docs/api/mg_send_mime_file2.md b/src/civetweb/docs/api/mg_send_mime_file2.md new file mode 100644 index 000000000..1350df8d6 --- /dev/null +++ b/src/civetweb/docs/api/mg_send_mime_file2.md @@ -0,0 +1,30 @@ +# Civetweb API Reference + +### `mg_send_mime_file2( conn, path, mime_type, additional_headers );` + +### Parameters + +| Parameter | Type | Description | +| :--- | :--- | :--- | +|**`conn`**|`struct mg_connection *`|The connection over which the file must be sent| +|**`path`**|`const char *`|The full path and filename of the file| +|**`mime_type`**|`const char *`|The mime type or NULL for automatic detection| +|**`additional_headers`**|`const char *`|Additional headers to be sent| + +### Return Value + +*none* + +### Description + +The function `mg_send_mime_file2()` can be used to send a file over a connection. The function is similar to [`mg_send_mime_file()`](mg_send_mime_file.md) with the additional functionality that user specified headers can be sent. The MIME type of the file can be specified in the function call, or will be automatically determined based on the extension of the filename if the `mime_type` parameter has the value NULL. + +Additional custom header fields can be added as a parameter. Please make sure that these header names begin with `X-` to prevent name clashes with other headers. If the `additional_headers` parameter is NULL, no custom headers will be added. + +### See Also + +* [`mg_get_builtin_mime_type();`](mg_get_builtin_mime_type.md) +* [`mg_printf();`](mg_printf.md) +* [`mg_send_file();`](mg_send_file.md) +* [`mg_send_mime_file();`](mg_send_mime_file.md) +* [`mg_write();`](mg_write.md) |