Imported Upstream version 7.59.0
[platform/upstream/curl.git] / docs / libcurl / curl_mime_name.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .TH curl_mime_name 3 "September 22, 2017" "libcurl 7.59.0" "libcurl Manual"
23
24 .SH NAME
25 curl_mime_name - set a mime part's name
26 .SH SYNOPSIS
27 .B #include <curl/curl.h>
28 .sp
29 .BI "CURLcode curl_mime_name(curl_mimepart * " part ", const char * " name ");"
30 .ad
31 .SH DESCRIPTION
32 \fIcurl_mime_name(3)\fP sets a mime part's name. This is the way HTTP form
33 fields are named.
34
35 \fIpart\fP is the part's handle to assign a name to.
36
37 \fIname\fP points to the zero-terminated name string.
38
39 The name string is copied into the part, thus the associated storage may
40 safely be released or reused after call. Setting a part's name twice is valid:
41 only the value set by the last call is retained. It is possible to "unname" a
42 part by setting \fIname\fP to NULL.
43 .SH AVAILABILITY
44 As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
45 .SH RETURN VALUE
46 CURLE_OK or a CURL error code upon failure.
47 .SH EXAMPLE
48 .nf
49  curl_mime *mime;
50  curl_mimepart *part;
51
52  /* create a mime handle */
53  mime = curl_mime_init(easy);
54
55  /* add a part */
56  part = curl_mime_addpart(mime);
57
58  /* give the part a name */
59  curl_mime_name(part, "shoe_size");
60 .fi
61 .SH "SEE ALSO"
62 .BR curl_mime_addpart "(3),"
63 .BR curl_mime_data "(3),"
64 .BR curl_mime_type "(3)"