Hello,
I am having problems posting a form to transmit for a file upload via an
HTTPS post, through the IE web browser, however it is successful in wininet.
I have created smart pointers to the interface and once a secured connection
is established I build a stream buffer (std::strstreambuf) for the form
transmission.
I am using the header Content-Type: multipart/form-data; and build the
buffer with
Content-Disposition: form-data; name="<fieldname>"; filename="<filename>"
Content-Type: image/* <fileimage>
then use the following:
std::strstreambuf buff
/***** pack upload into buff ****/
/***** create a safe array ******/
BYTE *Data;
VARIANT vPostData;
LPSAFEARRAY psa = SafeArrayCreateVector(VT_UI1, 0, buffpcount());
hr = SafeArrayAccessData(psa, (void**)&Data);
memcpy(Data, post.m_pdata->str(), post.m_pdata->pcount());
hr = SafeArrayUnaccessData(psa);
V_VT(&vPostData) = VT_ARRAY | VT_UI1;
V_ARRAY(&vPostData) = psa;
/** from an IWebBrowser2 instance i extract the App pointer and **/
/*** construct a BSTR with the header
**/
/** to use navigate to post the form as follows
***/
IWebBrowserAppPtr::Navigate(bUrl, &vtMissing, &vtMissing, &vPostData,
&vHeader);
The buffer appears to be transmitted and I receive no errors, however the
server is getting a corrupt transmission.
What may be wrong with this approach ?
Thanks for any assistance,
John Seganakis
EZ-Filing Inc.
segy@ezfiling.com
"They that give up essential liberty
to obtain a little temporary safety
deserve neither liberty nor safety."
- Ben Franklin