diff options
Diffstat (limited to 'src/GridText.c')
-rw-r--r-- | src/GridText.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/GridText.c b/src/GridText.c index c1b93045..c99011f5 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -11422,11 +11422,17 @@ int HText_SubmitForm(FormInfo * submit_item, DocInfo *doc, char *link_name, StrAllocCopy(escaped1, my_data[anchor_count].name); } else if (Boundary) { const char *t = guess_content_type(val_used); + char *copied_fname = NULL; StrAllocCopy(escaped1, "Content-Disposition: form-data"); HTSprintf(&escaped1, "; name=\"%s\"", my_data[anchor_count].name); - HTSprintf(&escaped1, "; filename=\"%s\"", val_used); + + StrAllocCopy(copied_fname, val_used); + HTMake822Word(&copied_fname, FALSE); + HTSprintf(&escaped1, "; filename=\"%s\"", copied_fname); + FREE(copied_fname); + /* Should we take into account the encoding? */ HTSprintf(&escaped1, "\r\nContent-Type: %s", t); if (my_data[anchor_count].quote == QUOTE_BASE64) |