Click here to Skip to main content
11,923,676 members (64,367 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Windows Mobile HTTP
Now,I want to post a zip file to the web,the key code on the below:
CHttpConnection * pHC = NULL;
	       CHttpFile * pHF = NULL;
	       CInternetSession cis;
               CString strBoundry = _T("-----------------------------7d86d16250370");
		pHF = pHC->OpenRequest(CHttpConnection::HTTP_VERB_POST, strObject);
		CString strHeader = MakeRequestHeaders(strBoundry,strFileName,strServer,wPort);
		CString strHeader1 = MakePreFileData(strBoundry,strFileName);
			if(!pHF->SendRequest(strHeader,0, pFileBuff, dwFileLength))   {
				pFileBuff = NULL;
				MessageBox(NULL,_T("upload failed!"),_T("Title"),MB_ICONEXCLAMATION|MB_OK);
				return FALSE;
			DWORD dwStateCode = 0;
		if(dwStateCode == HTTP_STATUS_OK)
			bResult = TRUE;
			MessageBox(NULL,_T("upload successed!"),_T ("Title"),MB_ICONEXCLAMATION|MB_OK);

Content-Type: multipart/form-data;
after excuted my code,the tomact notice me the asking rest service successful,but have no data.How can I upload a zip file to web?thanks
Posted 12-Dec-12 0:40am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151125.3 | Last Updated 12 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100