diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/fetch.c | 5 | ||||
-rw-r--r-- | content/fetch.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/content/fetch.c b/content/fetch.c index d42489694..8ab31c92c 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -676,13 +676,18 @@ bool fetch_process_headers(struct fetch *f) struct HttpPost *fetch_post_convert(struct form_successful_control *control) { struct HttpPost *post = 0, *last = 0; + char *mimetype = 0; for (; control; control = control->next) { if (control->file) { + mimetype = fetch_mimetype(control->value); curl_formadd(&post, &last, CURLFORM_COPYNAME, control->name, CURLFORM_FILE, control->value, + CURLFORM_CONTENTTYPE, + (mimetype != 0 ? mimetype : "text/plain"), CURLFORM_END); + xfree(mimetype); } else { curl_formadd(&post, &last, diff --git a/content/fetch.h b/content/fetch.h index 098ab39d1..e5dfff6a3 100644 --- a/content/fetch.h +++ b/content/fetch.h @@ -50,5 +50,6 @@ void fetch_abort(struct fetch *f); void fetch_poll(void); void fetch_quit(void); const char *fetch_filetype(const char *unix_path); +char *fetch_mimetype(const char *ro_path); #endif |