I used this code , it's the execute func of the content handler:
bool __fastcall TContentPP ::Execute(Iw::Http::Request::THttpRequest* aRequest, Iw::Http::Reply::THttpReply* aReply, const System::UnicodeString aPathname, Iwapplication::TIWApplication* aSession, System::Classes::TStrings* aParams)
{
bool rc = true;
UnicodeString empf;
THttpFile *xFile;
TFileStream *fs;
TStringStream *js;
if (aRequest->Files->Count > 0)
{
xFile = aRequest->Files->Items[0];
fs = new TFileStream(xFile->TempPathName, fmOpenRead | fmShareDenyNone);
js = new TStringStream;
js->CopyFrom(fs, 0);
empf = js->DataString;
delete fs;
delete js;
rc = true;
}
if (aReply)
{
aReply->ContentType = MIME_JSON;
aReply->Code = 200;
aReply->CodeText = "OK";
aReply->WriteString("{\"status\":\"success\"}"); // R?ckgabe eines JSON-Objekts
}
return rc;
}
//---------------------------------------------------------------------------
the string "empf" hold the json-reply I wait for.
bool __fastcall TContentPP ::Execute(Iw::Http::Request::THttpRequest* aRequest, Iw::Http::Reply::THttpReply* aReply, const System::UnicodeString aPathname, Iwapplication::TIWApplication* aSession, System::Classes::TStrings* aParams)
{
bool rc = true;
UnicodeString empf;
THttpFile *xFile;
TFileStream *fs;
TStringStream *js;
if (aRequest->Files->Count > 0)
{
xFile = aRequest->Files->Items[0];
fs = new TFileStream(xFile->TempPathName, fmOpenRead | fmShareDenyNone);
js = new TStringStream;
js->CopyFrom(fs, 0);
empf = js->DataString;
delete fs;
delete js;
rc = true;
}
if (aReply)
{
aReply->ContentType = MIME_JSON;
aReply->Code = 200;
aReply->CodeText = "OK";
aReply->WriteString("{\"status\":\"success\"}"); // R?ckgabe eines JSON-Objekts
}
return rc;
}
//---------------------------------------------------------------------------
the string "empf" hold the json-reply I wait for.