Click here to Skip to main content
15,895,656 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can I use system cmd without opening console? Pin
swarup12-May-03 3:31
swarup12-May-03 3:31 
AnswerRe: How can I use system cmd without opening console? Pin
David Crow12-May-03 3:44
David Crow12-May-03 3:44 
Answerthanks swarup & DavidCrow - great help Pin
YanivNahum12-May-03 4:20
YanivNahum12-May-03 4:20 
GeneralAdobe Acrobat ActiveX Control Pin
Poul Haahr Klemmensen12-May-03 2:17
Poul Haahr Klemmensen12-May-03 2:17 
GeneralRe: Adobe Acrobat ActiveX Control Pin
Paul Selormey12-May-03 4:27
Paul Selormey12-May-03 4:27 
GeneralRe: Adobe Acrobat ActiveX Control Pin
Poul Haahr Klemmensen12-May-03 20:27
Poul Haahr Klemmensen12-May-03 20:27 
GeneralRe: Adobe Acrobat ActiveX Control Pin
Paul Selormey12-May-03 20:42
Paul Selormey12-May-03 20:42 
GeneralUploading file thru WININET Pin
Tili12-May-03 2:12
Tili12-May-03 2:12 
Hi.

I am trying to upload a variable and file thru POST thru HTTP. The script is not getting both. IE works fine and I tried to use same headers as of IE> but still it doesnt work.
I also tried to send one variable thru multipart/form-data. but its not working.
Here is the code for sending one variable.
	CInternetSession session;<br />
	CHttpConnection *http=session.GetHttpConnection("192.168.0.2");<br />
	CHttpFile *pFile=http->OpenRequest(CHttpConnection::HTTP_VERB_POST,"/bluestar/post1.php",NULL,NULL,NULL,"HTTP /1.0",INTERNET_FLAG_RELOAD);<br />
	<br />
	CString sContent;<br />
	sContent= CString(HTML_BOUNDARY)+"\r\nContent-Disposition: form-data; name=\"packet\"\r\r";<br />
	sContent+="Faizan";<br />
	CString sEnding="\r"+CString(HTML_BOUNDARY)+"\r";<br />
<br />
<br />
	sContent+=sEnding;<br />
	CString sPacket;<br />
	CString str; <br />
	sPacket="Accept: */*\rAccept-Language: en\r";<br />
	sPacket+="Content-Type: multipart/form-data; boundary=" + CString(HTML_BOUNDARY)+"\r";<br />
	sPacket+="Connection: Keep-Alive\r";<br />
	str.Format("Content-Length: %d\r",sContent.GetLength());<br />
	sPacket+=str;	<br />
<br />
        pFile->SendRequest(sPacket,(LPVOID)(LPCTSTR)sContent,sContent.GetLength());<br />
	char szData[200];<br />
	int iRead=0;<br />
	while((iRead=pFile->Read(szData,200))>0)<br />
	{<br />
		szData[iRead]=NULL;<br />
		TRACE("Read back is %s\n",szData);<br />
		m_eRec+=szData;<br />
	<br />
	}	<br />
	UpdateData(FALSE);<br />
<br />
	pFile->Close();<br />
	http->Close();


Has anybody done this before using multipart/form-data.
GeneralRe: Uploading file thru WININET Pin
Asmenok30-Sep-03 3:16
Asmenok30-Sep-03 3:16 
General3d game.. like DOOM for console:) Pin
Member 25795612-May-03 2:12
Member 25795612-May-03 2:12 
QuestionHow to knew that a NT/2000 User has logon on? Pin
GooBears12-May-03 2:09
GooBears12-May-03 2:09 
AnswerRe: How to knew that a NT/2000 User has logon on? Pin
Maxwell Chen13-May-03 1:19
Maxwell Chen13-May-03 1:19 
QuestionWhere to Find MFC FAQ? Pin
Haja12-May-03 1:52
Haja12-May-03 1:52 
AnswerRe: Where to Find MFC FAQ? Pin
Kevin McFarlane12-May-03 1:58
Kevin McFarlane12-May-03 1:58 
GeneralRe: Where to Find MFC FAQ? Pin
GooBears12-May-03 2:06
GooBears12-May-03 2:06 
AnswerRe: Where to Find MFC FAQ? Pin
David Crow12-May-03 2:29
David Crow12-May-03 2:29 
GeneralClickety police ! Pin
Trollslayer12-May-03 2:56
mentorTrollslayer12-May-03 2:56 
GeneralBitmap Pin
midupk12-May-03 1:52
midupk12-May-03 1:52 
GeneralRe: Bitmap Pin
midupk12-May-03 1:53
midupk12-May-03 1:53 
Generaltext in video Pin
sharlila12-May-03 1:17
sharlila12-May-03 1:17 
GeneralButton with Bitmap Pin
Rage12-May-03 0:10
professionalRage12-May-03 0:10 
GeneralRe: Button with Bitmap Pin
macmac3812-May-03 0:18
macmac3812-May-03 0:18 
GeneralRe: Button with Bitmap Pin
Rage12-May-03 1:29
professionalRage12-May-03 1:29 
GeneralRe: Button with Bitmap Pin
Member 25795612-May-03 0:20
Member 25795612-May-03 0:20 
GeneralRe: Button with Bitmap Pin
Member 25795612-May-03 0:23
Member 25795612-May-03 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.