From 407c7fab874cbbadae7c0f1f961dee4775599278 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 26 Apr 2020 16:52:48 -0400 Subject: Fall back to Content-Type name parameter for attachments --- export.c | 1 + html.c | 1 + 2 files changed, 2 insertions(+) diff --git a/export.c b/export.c index 7a04358..ab77587 100644 --- a/export.c +++ b/export.c @@ -155,6 +155,7 @@ static int exportHTMLAttachment( ); } const char *name = paramGet(part->disposition.params, "filename"); + if (!name) name = paramGet(part->params, "name"); const char *disposition = part->disposition.type; if (!disposition) disposition = "INLINE"; diff --git a/html.c b/html.c index 3bd192a..d884b63 100644 --- a/html.c +++ b/html.c @@ -275,6 +275,7 @@ int htmlAttachment( ); char *url = templateURL("../" PATH_ATTACHMENT, path); const char *name = paramGet(part->disposition.params, "filename"); + if (!name) name = paramGet(part->params, "name"); struct Variable vars[] = { { "url", url }, { "name", (name ? name : "") }, -- cgit 1.4.1