From d224b8291d8ccbd427e6851b8da26d198f05ef3d Mon Sep 17 00:00:00 2001 From: bel Date: Sun, 14 Feb 2016 23:25:24 +0100 Subject: [PATCH] Alternative to mg_upload (Step 53/?) --- src/civetweb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/civetweb.c b/src/civetweb.c index 55c25f80..42e57d2f 100644 --- a/src/civetweb.c +++ b/src/civetweb.c @@ -8967,9 +8967,12 @@ mg_upload(struct mg_connection *conn, const char *destination_dir) struct mg_form_data_handler fdh = {mg_upload_field_found, NULL, mg_upload_field_stored, - &fud}; + 0}; + int ret; + + fdh.user_data = (void *)&fud; + ret = mg_handle_form_request(conn, &fdh); - int ret = mg_handle_form_request(conn, &fdh); if (ret < 0) { mg_cry(conn, "%s: Error while parsing the request", __func__); }