From 7e922c290f8ab3a4f72608da661428f573459e39 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 21 Mar 2004 21:32:15 +0000 Subject: [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 --- riscos/filetype.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'riscos/filetype.c') 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; -- cgit v1.2.3