I'm having an issue with opening a file as binary then uploading via the WinHttp.WinHttpRequest.5.1
I basiclly need something like below, but I can't use _bstr_t because it's binary.. I've tried doing this with pure char* but when I do that, I get nothing sent to the server. At least the code below uploads something and the server receives it as a zip.. Only the zip will be corrupted for obvious reasons.
pIWinHttpRequest->SetRequestHeader("Content-Type", "multipart/form-data; boundary=Xu02=$");
_bstr_t strBody = "--Xu02=$\r\nContent-Disposition: form-data; name=\"TestFile\"; filename=\"MyFile.zip\"\r\nContent-type: file\r\n\r\n";
strBody += buffer;
strBody += "\r\n--Xu02=$--";
hr = pIWinHttpRequest->Send(strBody);