CHttpFile->WriteString
-
Hi I have one CString strData with data and i want to send it on to the server in Chunk of 500 Bytes only.Please tell me how can i do that. Right now i am sending it as whole. here is the code strData = _T("Data=") + URLEncode2(strData); pHttpFile->AddRequestHeaders(strHeaders); pHttpFile->SendRequestEx(strData.GetLength()); pHttpFile->WriteString(strData); Thanks Shailesh
-
Hi I have one CString strData with data and i want to send it on to the server in Chunk of 500 Bytes only.Please tell me how can i do that. Right now i am sending it as whole. here is the code strData = _T("Data=") + URLEncode2(strData); pHttpFile->AddRequestHeaders(strHeaders); pHttpFile->SendRequestEx(strData.GetLength()); pHttpFile->WriteString(strData); Thanks Shailesh
Why not use something like:
int x = 0;
do
{
CString strSend = strData.Mid(x, 500);
x = x + 500;
// send it now
} while (! strSend.IsEmpty());
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-
Why not use something like:
int x = 0;
do
{
CString strSend = strData.Mid(x, 500);
x = x + 500;
// send it now
} while (! strSend.IsEmpty());
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-
While going into loop it throws the exception at strSend = strData.Mid(x,500) after going into loop 2 or 3 times . May be it is reached at the end of strData. Any Suggestion Thanks Shailesh
Stepping into the call to
CString::Mid()
that asserts would have revealed the problem (hopefully). If the length of the string at pointx
is less than 500, ...
"One must learn from the bite of the fire to leave it alone." - Native American Proverb