diff options
author | 2009-04-25 14:47:16 -0400 | |
---|---|---|
committer | 2009-04-25 14:47:16 -0400 | |
commit | d2274ae571370a5f0b88a6b0a5b264fde29378b9 (patch) | |
tree | a76de7cb5b97a481d0ef3ddb3b406ae4b0f67a7f /src | |
parent | 3d0a7f3cd81daaa7d49de95de7fe4eb8d1288876 (diff) |
Add MIME type to file
Diffstat (limited to 'src')
-rw-r--r-- | src/c/driver.c | 2 | ||||
-rw-r--r-- | src/c/urweb.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/c/driver.c b/src/c/driver.c index 6e06f32b..c95f8886 100644 --- a/src/c/driver.c +++ b/src/c/driver.c @@ -393,7 +393,7 @@ static void *worker(void *data) { part += boundary_len; if (filename) { - uw_Basis_file f = {filename, {part_len, after_sub_headers}}; + uw_Basis_file f = {filename, type, {part_len, after_sub_headers}}; uw_set_file_input(ctx, name, f); } else diff --git a/src/c/urweb.c b/src/c/urweb.c index a73371ef..ff4d5c8f 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -632,7 +632,7 @@ uw_Basis_file uw_get_file_input(uw_context ctx, int n) { case UNSET: { char *data = uw_malloc(ctx, 0); - uw_Basis_file f = {"", {0, data}}; + uw_Basis_file f = {NULL, "", {0, data}}; return f; } case FIL: @@ -2128,6 +2128,10 @@ uw_Basis_string uw_Basis_fileName(uw_context ctx, uw_Basis_file f) { return f.name; } +uw_Basis_string uw_Basis_fileMimeType(uw_context ctx, uw_Basis_file f) { + return f.type; +} + uw_Basis_blob uw_Basis_fileData(uw_context ctx, uw_Basis_file f) { return f.data; } |