summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-03-21 21:32:15 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-03-21 21:32:15 +0000
commit7e922c290f8ab3a4f72608da661428f573459e39 (patch)
tree634ba4c2cca135353c35bd29ac94691717551f1e /content
parent3aeafecd7b547e3f535fb5a700fc20e590dab967 (diff)
downloadnetsurf-7e922c290f8ab3a4f72608da661428f573459e39.tar.gz
netsurf-7e922c290f8ab3a4f72608da661428f573459e39.tar.bz2
[project @ 2004-03-21 21:32:15 by jmb]
Fix for SparkFS causing problems with uploading zip files. Map filetypes to mimetype properly. svn path=/import/netsurf/; revision=646
Diffstat (limited to 'content')
-rw-r--r--content/fetch.c5
-rw-r--r--content/fetch.h1
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