summaryrefslogtreecommitdiffstats
path: root/plugins/samples
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2016-01-26 13:06:17 +0100
committerFulup Ar Foll <fulup@iot.bzh>2016-01-26 13:06:17 +0100
commitacd9ae252049d89ca7907995d94b6c6b0b643379 (patch)
tree6d16a186ee0673b65fbf676305f6df1e79ef7500 /plugins/samples
parentb2247ca634420ed0d5ecc1743834ea4e0666aa2a (diff)
Fixed Post File Upload
Diffstat (limited to 'plugins/samples')
-rw-r--r--plugins/samples/SamplePost.c12
1 files changed, 4 insertions, 8 deletions
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