Click here to Skip to main content
15,920,666 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ReadDirectoryChangesW() "An unexpected network error occurred." Pin
Neville Franks30-Sep-04 10:37
Neville Franks30-Sep-04 10:37 
GeneralRe: ReadDirectoryChangesW() "An unexpected network error occurred." Pin
Neville Franks30-Sep-04 10:37
Neville Franks30-Sep-04 10:37 
Generaledt1 problem in vc .net Pin
Michael Liu29-Sep-04 11:43
Michael Liu29-Sep-04 11:43 
GeneralDrawing chart/diagram Pin
rltsoft29-Sep-04 10:58
rltsoft29-Sep-04 10:58 
GeneralRe: Drawing chart/diagram Pin
Christian Graus29-Sep-04 12:31
protectorChristian Graus29-Sep-04 12:31 
GeneralRe: Drawing chart/diagram Pin
BAIJUMAX29-Sep-04 19:52
professionalBAIJUMAX29-Sep-04 19:52 
GeneralSmart Tag control Pin
ssanoj29-Sep-04 9:46
ssanoj29-Sep-04 9:46 
Generalphp upload to file from c program Pin
Spiritofamerica29-Sep-04 9:46
Spiritofamerica29-Sep-04 9:46 
hello,

The program that I am making needs to allow the user to upload a file from his harddisk by pushing a button just like he would normally do on a php page.

The file must be uploaded via php on remote server of course.

I am trying a trick I saw on a website since php no longer supports just plain uploading without the user pressing some kind of button I have beet trying to simulate a button pushing like this:


<br />
<br />
	strcpy(lpContentLength, "Content-Length: %d\r\n");	<br />
	strcpy(lpContentType, "Content-Type: multipart/form-data; ");<br />
	strcpy(lpPOST, "POST");<br />
	strcpy(lpMimeHeader,<br />
			"-----------------------------7d414e351603fa\r\n"<br />
			"Content-Disposition: form-data; name=\"upload\"; filename=\"%s\"\r\n"<br />
			"Content-Type: application/octet-stream\r\n"<br />
			"\r\n");	<br />
	strcpy(lpMimeTail,<br />
			"\r\n-----------------------------7d414e351603fa\r\n"<br />
			"Content-Disposition: form-data; name=\"submit\"\r\n\r\n"<br />
			"Upload Files\r\n"<br />
			"-----------------------------7d414e351603fa--\r\n");<br />
	strcpy(lpUserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; Win32)");	<br />
<br />
	sprintf(szMimeHeader, lpMimeHeader, lpFilename);	<br />
	sprintf(szMimeTail, lpMimeTail);<br />
	MessageBox(0, szMimeHeader, "ada", MB_OK);<br />
	MessageBox(0, szMimeTail, "ada", MB_OK);<br />
	dwMimeHeaderLen	= strlen(szMimeHeader);<br />
	dwMimeTailLen	= strlen(szMimeTail);<br />

then of course I read the file, stick the MIME at the end of it and use win32 internet functions to get the data to the php waiting on the other side but it doesn't work, anyone know why? Is the mime header wrong?

I could provide the rest of the code also if you think there might be something wrong with it.
GeneralUnable to insert records to Excel Table Pin
P.Satish29-Sep-04 9:27
P.Satish29-Sep-04 9:27 
GeneralFlash Programming in VC++ Pin
Azghar Hussain29-Sep-04 9:09
professionalAzghar Hussain29-Sep-04 9:09 
GeneralRe: Flash Programming in VC++ Pin
Christian Graus29-Sep-04 10:52
protectorChristian Graus29-Sep-04 10:52 
GeneralRe: Flash Programming in VC++ Pin
Ryan Binns29-Sep-04 18:07
Ryan Binns29-Sep-04 18:07 
GeneralRe: Flash Programming in VC++ Pin
parths29-Sep-04 23:06
parths29-Sep-04 23:06 
GeneralStdafx.h and the C1010 and C1034 errors Pin
NietzscheDisciple29-Sep-04 8:19
NietzscheDisciple29-Sep-04 8:19 
GeneralCDialog Drawing Pin
Gagnon Claude29-Sep-04 7:44
Gagnon Claude29-Sep-04 7:44 
GeneralRe: CDialog Drawing Pin
Maximilien29-Sep-04 8:38
Maximilien29-Sep-04 8:38 
Questionhow to obtain the PCMCIA drive Pin
elephantstar29-Sep-04 7:43
elephantstar29-Sep-04 7:43 
GeneralRegsvr32 writes an error Pin
Rassul Yunussov29-Sep-04 7:02
Rassul Yunussov29-Sep-04 7:02 
GeneralRe: Regsvr32 writes an error Pin
Renjith Ramachandran29-Sep-04 7:17
Renjith Ramachandran29-Sep-04 7:17 
GeneralRe: Regsvr32 writes an error Pin
BAIJUMAX29-Sep-04 20:07
professionalBAIJUMAX29-Sep-04 20:07 
GeneralRe: Regsvr32 writes an error Pin
David Crow29-Sep-04 7:20
David Crow29-Sep-04 7:20 
GeneralRe: Regsvr32 writes an error Pin
Mike Beckerleg29-Sep-04 11:44
Mike Beckerleg29-Sep-04 11:44 
GeneralRe: Regsvr32 writes an error Pin
Rassul Yunussov29-Sep-04 18:14
Rassul Yunussov29-Sep-04 18:14 
GeneralRe: Regsvr32 writes an error Pin
Mike Beckerleg29-Sep-04 21:50
Mike Beckerleg29-Sep-04 21:50 
GeneralRe: Regsvr32 writes an error Pin
Rassul Yunussov29-Sep-04 18:34
Rassul Yunussov29-Sep-04 18:34 

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.