summaryrefslogtreecommitdiff
path: root/lib/mime.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-02-04 09:23:11 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-02-05 13:50:30 +0100
commit84ad1fd3047815f9c6e78728bb351b828eac10b1 (patch)
tree31e2d053c836cf6bde3ae02a248e325a4c433bdf /lib/mime.h
parenta19afaccfeb5a77c15fdfc1c2be16fb27828cefc (diff)
downloadgnurl-84ad1fd3047815f9c6e78728bb351b828eac10b1.tar.gz
gnurl-84ad1fd3047815f9c6e78728bb351b828eac10b1.tar.bz2
gnurl-84ad1fd3047815f9c6e78728bb351b828eac10b1.zip
formdata: use the mime-content type function
Reduce code duplication by making Curl_mime_contenttype available and used by the formdata function. This also makes the formdata function recognize a set of more file extensions by default. PR #2280 brought this to my attention. Closes #2282
Diffstat (limited to 'lib/mime.h')
-rw-r--r--lib/mime.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/mime.h b/lib/mime.h
index 920a8a77a..4d5c70404 100644
--- a/lib/mime.h
+++ b/lib/mime.h
@@ -30,6 +30,10 @@
#define MIME_USERHEADERS_OWNER (1 << 0)
#define MIME_BODY_ONLY (1 << 1)
+#define FILE_CONTENTTYPE_DEFAULT "application/octet-stream"
+#define MULTIPART_CONTENTTYPE_DEFAULT "multipart/mixed"
+#define DISPOSITION_DEFAULT "attachment"
+
/* Part source kinds. */
enum mimekind {
MIMEKIND_NONE = 0, /* Part not set. */
@@ -134,5 +138,6 @@ size_t Curl_mime_read(char *buffer, size_t size, size_t nitems,
void *instream);
CURLcode Curl_mime_rewind(curl_mimepart *part);
CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...);
+const char *Curl_mime_contenttype(const char *filename);
#endif /* HEADER_CURL_MIME_H */