Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WinInet - multipart POST issue

Status
Not open for further replies.

jsitke

Programmer
Jun 28, 2001
7
US
I am doing a multipart POST to a form. The data contains a ZIP file so I need to include a "boundary". The problem I am having is that I cannot add the boundaries in between the data. Whenever I add them, it never shows uip in the header. How can I add the proper headers to my POST?

Code:
const char* boundary = "--------------------7d021a37605f0\r\n";

const char* allHeader = "Accept: */*\r\nCache-Control: no-cache\r\nAccept-Language: en-us\r\nContent-type: multipart/form-data; boundary=\"---------------------------7d021a37605f0\"\r\n";

HttpAddRequestHeaders(hResourceHandle,allHeader,strlen(allHeader)+1,HTTP_ADDREQ_FLAG_ADD);

const char * contentZipType = "Content-Type: application/x-zip-compressed\r\n";
HttpAddRequestHeaders(hResourceHandle,contentZipType,sizeof(contentZipType),HTTP_ADDREQ_FLAG_ADD);

/* binary data goes here */

HttpAddRequestHeaders(hResourceHandle,boundary,strlen(boundary)+1,HTTP_ADDREQ_FLAG_ADD);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top