]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/docs/api/mg_send_mime_file2.md
buildsys: switch source download to quincy
[ceph.git] / ceph / src / civetweb / docs / api / mg_send_mime_file2.md
1 # Civetweb API Reference
2
3 ### `mg_send_mime_file2( conn, path, mime_type, additional_headers );`
4
5 ### Parameters
6
7 | Parameter | Type | Description |
8 | :--- | :--- | :--- |
9 |**`conn`**|`struct mg_connection *`|The connection over which the file must be sent|
10 |**`path`**|`const char *`|The full path and filename of the file|
11 |**`mime_type`**|`const char *`|The mime type or NULL for automatic detection|
12 |**`additional_headers`**|`const char *`|Additional headers to be sent|
13
14 ### Return Value
15
16 *none*
17
18 ### Description
19
20 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.
21
22 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.
23
24 ### See Also
25
26 * [`mg_get_builtin_mime_type();`](mg_get_builtin_mime_type.md)
27 * [`mg_printf();`](mg_printf.md)
28 * [`mg_send_file();`](mg_send_file.md)
29 * [`mg_send_mime_file();`](mg_send_mime_file.md)
30 * [`mg_write();`](mg_write.md)