summaryrefslogtreecommitdiff
path: root/docs/libcurl/curl_mime_filename.3
diff options
context:
space:
mode:
Diffstat (limited to 'docs/libcurl/curl_mime_filename.3')
-rw-r--r--docs/libcurl/curl_mime_filename.322
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/libcurl/curl_mime_filename.3 b/docs/libcurl/curl_mime_filename.3
index db4482cdd..5a2ca6ec2 100644
--- a/docs/libcurl/curl_mime_filename.3
+++ b/docs/libcurl/curl_mime_filename.3
@@ -35,6 +35,7 @@ content source. A part's remote file name is transmitted to the server in the
associated Content-Disposition generated header.
\fIpart\fP is the part's handle to assign the remote file name to.
+
\fIfilename\fP points to the nul-terminated file name string; it may be set to
NULL to remove a previously attached remote file name.
@@ -45,6 +46,27 @@ name twice is valid: only the value set by the last call is retained.
As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
.SH RETURN VALUE
CURLE_OK or a CURL error code upon failure.
+.SH EXAMPLE
+.nf
+ struct curl_mime *mime;
+ struct mimepart *part;
+
+ /* create a mime handle */
+ mime = curl_mime_init(easy);
+
+ /* add a part */
+ part = curl_mime_addpart(mime);
+
+ /* send image data from memory */
+ curl_mime_data(part, imagebuf, imagebuf_len);
+
+ /* set a file name to make it look like a file upload */
+ curl_mime_filename(part, "image.png");
+
+ /* set name */
+ curl_mime_name(part, "data", CURL_ZERO_TERMINATED);
+.fi
.SH "SEE ALSO"
.BR curl_mime_addpart "(3) "
.BR curl_mime_filedata "(3) "
+.BR curl_mime_data "(3) "