Hello,

I want to access the body of a request message, i.e when u r trying to upload say a jpg file want to get the information of the data being posted.

I am trying to do this in a HTTP filter.

I am trying to achieve this in the following manner:

Where Chtppfill is derived from CECOMFilter, MHTTPFilter and MHTTPDataSupplier

void Chttpfill::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
{

switch (aEvent.iStatus)
{

case THTTPEvent::ESubmit:
{
RHTTPRequest aRequest;
TBool HasBody = aTransaction.Request().HasBody();

if(HasBody==1)
{

//iDataSupplier = aTransaction.Request().Body();

//TBool isLast = iDataSupplier->GetNextDataPart(ptr);

MHTTPDataSupplier* DataSupplier = this;
DataSupplier = aTransaction.Request().Body();
TBool Last = DataSupplier->GetNextDataPart(ptr);
if(ptr.Match(KMatch1)||ptr.Match(KMatch2)== 0)
{
_LIT(KExeName,"Display.exe");
_LIT(KNULL,"PlayAd");
TInt res=KErrNone;
RProcess aProcess;
// Create the server, if one with this name does not already exist.
TFindServer aFindServer(KExeName);
TFullName aName;
if (aFindServer.Next(aName)!=KErrNone)
{
// Create the thread for the server.
res=aProcess.Create(KExeName, KNULL, EOwnerProcess);

// The thread has been created OK so get it started - however
// we need to make sure that it has started before we continue.
if (res==KErrNone)
{
aProcess.SetPriority(EPriorityHigh);
aProcess.Resume();
}
// The thread has not been created - clearly there's been a problem.
else
{
aProcess.Close();
}
}
}
/*if(isLast==EFalse)
{*/
/* RFs fs;
RFile iFile;
User::LeaveIfError(fs.Connect());
if(iFile.Open(fs,KMyFile,EFileShareExclusive|EFileWrite)!=KErrNone)
{
User::LeaveIfError(iFile.Create(fs,KMyFile,EFileShareExclusive|EFileWrite));
}
iFile.Write(ptr);
iFile.Close();
fs.Close();*/
//}
}
//iDataSupplier->ReleaseData();
}
/*else
{
User::InfoPrint(_L(" No Body"));
}*/
break;


When I am trying to access the body of the request message using TBool Last = DataSupplier->GetNextDataPart(ptr);
The whole uploading event getting blocked and will not be able to upload the data, it raises a panic unable to perform operation -20000!

Can anyone please help me in this regard.

Regards