PUBLIC AFB_PostHandle* getPostHandle (AFB_request *request);
PUBLIC json_object* getPostFile (AFB_request *request, AFB_PostItem *item, char* destination) ;
PUBLIC AFB_PostCtx* getPostContext (AFB_request *request);
+PUBLIC char* getPostPath (AFB_request *request);
// rest-api
PUBLIC void endPostRequest(AFB_PostHandle *posthandle);
// 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 done");
+ postFileCtx->jresp = jsonNewMessage(AFB_SUCCESS,"UploadFile Post Appli=%s done", getPostPath (request));
}
}
return ((AFB_PostCtx*) postHandle->ctx);
}
+PUBLIC char* getPostPath (AFB_request *request) {
+ AFB_PostHandle *postHandle = getPostHandle(request);
+ AFB_PostCtx *postFileCtx;
+
+ if (postHandle == NULL) return NULL;
+
+ postFileCtx = (AFB_PostCtx*) postHandle->ctx;
+ if (postFileCtx == NULL) return NULL;
+
+ return (postFileCtx->path);
+}
+
PUBLIC json_object* getPostFile (AFB_request *request, AFB_PostItem *item, char* destination) {
AFB_PostHandle *postHandle = getPostHandle(request);