From 7a09cb9c612997b255cdebec7759d4a0c37f3c22 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Tue, 23 Jan 2018 21:47:34 +1000 Subject: [PATCH] fixes... looks to be working now --- src/www.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/www.c b/src/www.c index d648900..a3163fb 100644 --- a/src/www.c +++ b/src/www.c @@ -8,6 +8,7 @@ #include #include #include +#include #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) #include #endif @@ -855,6 +856,7 @@ int www_handler(void * cls, struct MHD_Connection * connection, const char * url MHD_add_response_header(response, MHD_HTTP_HEADER_CONTENT_TYPE, mime); sprintf(buffer, "%ld", s.st_size); MHD_add_response_header(response, MHD_HTTP_HEADER_CONTENT_LENGTH, buffer); + snprintf(buffer, PATH_MAX, "attachment; filename=\"%s\"", basename(filename)); MHD_add_response_header(response, MHD_HTTP_HEADER_CONTENT_DISPOSITION, buffer); ret = MHD_queue_response (connection, MHD_HTTP_OK, response);