summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/fetch.c5
-rw-r--r--content/fetch.h1
-rw-r--r--render/form.c1
-rw-r--r--riscos/filetype.c16
-rw-r--r--riscos/gui.c6
5 files changed, 24 insertions, 5 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
diff --git a/render/form.c b/render/form.c
index 145ef68bd..47dbbcd0b 100644
--- a/render/form.c
+++ b/render/form.c
@@ -16,7 +16,6 @@
#include "curl/curl.h"
#include "netsurf/render/box.h"
#include "netsurf/render/form.h"
-#include "netsurf/utils/log.h"
#include "netsurf/utils/utils.h"
diff --git a/riscos/filetype.c b/riscos/filetype.c
index 0273558cb..4a4a9c92d 100644
--- a/riscos/filetype.c
+++ b/riscos/filetype.c
@@ -76,6 +76,22 @@ const char *fetch_filetype(const char *unix_path)
}
+char *fetch_mimetype(const char *ro_path) {
+
+ os_error *e;
+ bits filetype;
+ char *mime = xcalloc(256, sizeof(char));
+
+ e = xosfile_read_stamped_no_path(ro_path, 0, 0, 0, 0, 0, &filetype);
+ if (e) return 0;
+
+ e = xmimemaptranslate_filetype_to_mime_type(filetype, mime);
+ if (e) return 0;
+
+ return mime;
+}
+
+
int cmp_type(const void *x, const void *y)
{
const bits *p = x;
diff --git a/riscos/gui.c b/riscos/gui.c
index 7f9631f68..b95ec47a8 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <unixlib/features.h>
#include <unixlib/local.h>
#include "oslib/hourglass.h"
#include "oslib/inetsuite.h"
@@ -49,6 +50,7 @@
const char *__dynamic_da_name = "NetSurf"; /**< For UnixLib. */
+int __feature_imagefs_is_file = 1; /**< For UnixLib. */
char *NETSURF_DIR;
wimp_menu *combo_menu;
@@ -863,8 +865,6 @@ void ro_msg_dataload(wimp_message *message)
if (!temp) break;
if (temp[0] == '#') continue; /* ignore commented lines */
- LOG(("%d: %s", lineno, temp));
-
lineno++;
}
@@ -875,8 +875,6 @@ void ro_msg_dataload(wimp_message *message)
url = xstrdup(temp);
- LOG(("%s", url));
-
xfree(buf);
}