Regarding file uploading to server | developer.brewmp.com Regarding file uploading to server | developer.brewmp.com

Developer

Regarding file uploading to server

Forums:

Hi

I 've written the following code for uploding a text file to a server using IWeb. On execution , simulator is displaying "Default.aspx". It seems that everything has gone right but nothing gets transfered to server. I 'm falling in the perplexed situation whether i need to write the uploaded bytes to file at the server side or IWeb directly uploads the file to server.
Moreover i 've used IPeek instead on ISource as suggested by one of my guide but still the problem is persisting.

void uploadFile()
{
int32 readByte;
ISource *pISource;
ISourceUtil *pISourceUtil;
uint32 dwCount =1;
char *returnstr = (char*)MALLOC(30);

int i=0;
char c;
pMe->FileReaderBuffer=(char*)MALLOC(30);
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SOURCEUTIL,(void**)&pISourceUtil);
pMe->pIFile = IFILEMGR_OpenFile(pMe->pIFileMgr,"./Region_strName.dat",_OFM_READ);

ISOURCEUTIL_SourceFromAStream(pISourceUtil,(IAStream*)pMe->pIFile,&pISource);
if(pMe->m_pIWeb==NULL)
{
ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_WEB, (void**)(&pMe->m_pIWeb));
}
CALLBACK_Init(&pMe->m_Callback,WebReadSummary,pMe);
IWEB_GetResponse(pMe->m_pIWeb, (pMe->m_pIWeb, &pMe->m_pIWebResp, &pMe->m_Callback,"http://localhost:1307/WebSite1/Default.aspx",
WEBOPT_HANDLERDATA, pMe,
WEBOPT_HEADER,"X-Method:POST\r\n",
WEBOPT_STATUSHANDLER, WebStatusNotification,
WEBOPT_METHOD,"POST",
WEBOPT_BODY,pISource,
WEBOPT_END));

}