From acd9ae252049d89ca7907995d94b6c6b0b643379 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Tue, 26 Jan 2016 13:06:17 +0100 Subject: Fixed Post File Upload --- plugins/samples/SamplePost.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'plugins/samples/SamplePost.c') diff --git a/plugins/samples/SamplePost.c b/plugins/samples/SamplePost.c index 9828349a..e419be45 100644 --- a/plugins/samples/SamplePost.c +++ b/plugins/samples/SamplePost.c @@ -47,14 +47,10 @@ STATIC json_object* UploadAppli (AFB_request *request, AFB_PostItem *item) { // This is called after PostForm and then after DonePostForm if (item == NULL) { - AFB_PostCtx *postFileCtx = getPostContext(request); - if (postFileCtx != NULL) { - - // Do something intelligent here to install application - - postFileCtx->errcode = MHD_HTTP_OK; // or error is something went wrong; - postFileCtx->jresp = jsonNewMessage(AFB_SUCCESS,"UploadFile Post Appli=%s done", getPostPath (request)); - } + // Do something intelligent here to install application + request->errcode = MHD_HTTP_OK; // or error is something went wrong; + request->jresp = jsonNewMessage(AFB_SUCCESS,"UploadFile Post Appli=%s done", getPostPath (request)); + // Note: should not return here in order getPostedFile to clear Post resources. } // upload multi iteration logic is handle by getPostedFile -- cgit 1.2.3-korg