From 581d87757601286fbb8250abc8d2bd185dddecb7 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 4 Jan 2014 19:34:04 +0000 Subject: In theory, store raw filenames and pass them through for file upload. Untested due to no file-upload in GTK frontend just yet --- content/fetch.c | 2 ++ content/fetch.h | 1 + content/fetchers/curl.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/fetch.c b/content/fetch.c index 1ff925ae3..ffc907891 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -665,6 +665,8 @@ void fetch_multipart_data_destroy(struct fetch_multipart_data *list) next = list->next; free(list->name); free(list->value); + if (list->file) + free(list->rawfile); free(list); } } diff --git a/content/fetch.h b/content/fetch.h index d23b3cd4b..a173f7f30 100644 --- a/content/fetch.h +++ b/content/fetch.h @@ -79,6 +79,7 @@ struct fetch_multipart_data { bool file; /**< Item is a file */ char *name; /**< Name of item */ char *value; /**< Item value */ + char *rawfile; /**< Raw filename if file is true */ struct fetch_multipart_data *next; /**< Next in linked list */ }; diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c index 1dfc44631..7578ad4cb 100644 --- a/content/fetchers/curl.c +++ b/content/fetchers/curl.c @@ -1301,7 +1301,7 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control) char *mimetype = fetch_mimetype(control->value); code = curl_formadd(&post, &last, CURLFORM_COPYNAME, control->name, - CURLFORM_FILE, control->value, + CURLFORM_FILE, control->rawfile, CURLFORM_FILENAME, leafname, CURLFORM_CONTENTTYPE, (mimetype != 0 ? mimetype : "text/plain"), -- cgit v1.2.3