L
larry
Hi, I did a client program to send data to the server. there is a C++ CGI
program on the server to get the data.
It works perfectly on my local computer when each time I test it with my IIS
(server name "localhost"). But it doesn't work when I tried two different
computers(one server, another is client). neither my company website.
The connection looks ok, but just cannot send the data.
Do I need any special settings on the server side?
thanks a lot.
larry
here is the major client side code:
code:-----------------------------------------------------------------------
-------
sprintf((char *)pBuffer,"/cgi_bin/CGIRec.exe?upload
%s",p->m_sRemoteFileName);
p->m_pFile =
p->m_pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,(char
*)pBuffer);
p->m_pFile->SendRequestEx(file.GetLength());
do
{
dwBytesRead=file.Read( pBuffer, sizeof(pBuffer));
p->m_pFile->Write(pBuffer, dwBytesRead);
}
while (dwBytesRead == sizeof(pBuffer)) ;
p->m_pFile->EndRequest();
DWORD dwFlags;
p->m_pFile->QueryInfoStatusCode(dwFlags);
if(dwFlags>=300) AfxThrowUserException( ); // program out here
program on the server to get the data.
It works perfectly on my local computer when each time I test it with my IIS
(server name "localhost"). But it doesn't work when I tried two different
computers(one server, another is client). neither my company website.
The connection looks ok, but just cannot send the data.
Do I need any special settings on the server side?
thanks a lot.
larry
here is the major client side code:
code:-----------------------------------------------------------------------
-------
sprintf((char *)pBuffer,"/cgi_bin/CGIRec.exe?upload
%s",p->m_sRemoteFileName);
p->m_pFile =
p->m_pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,(char
*)pBuffer);
p->m_pFile->SendRequestEx(file.GetLength());
do
{
dwBytesRead=file.Read( pBuffer, sizeof(pBuffer));
p->m_pFile->Write(pBuffer, dwBytesRead);
}
while (dwBytesRead == sizeof(pBuffer)) ;
p->m_pFile->EndRequest();
DWORD dwFlags;
p->m_pFile->QueryInfoStatusCode(dwFlags);
if(dwFlags>=300) AfxThrowUserException( ); // program out here