如何用 HTTP Post 文件(二进制文件)给Web site
服务器端用标准的上传组件接受
望高手指点

解决方案 »

  1.   

    this is A small class that handles HTTP POST, GET and HEAD operations,you can open your binary file and read it to a string ,then post it,see  
    http://www.codeproject.com/useritems/amhttputils.asp
      

  2.   

    also you can consult this
    “Q165298 HOWTO: Simulate a Form POST Request Using WinInet”
      

  3.   

    //创建任务
    m_FileIe = InternetOpen(m_SmallBuf,INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
    if(m_FileIe == NULL)
    {
    return FALSE;
    } //请求连接
    pFileHc = InternetConnect(m_FileIe,m_ServerIp,atoi(m_ServerPort),NULL,NULL,
    INTERNET_SERVICE_HTTP,0,0);
    if(pFileHc == NULL)
    {
    CleanFileHandle();
    return FALSE;
    } //取校验数据
    GetVerify(m_Verify);
    sprintf(m_SmallBuf,"9998%s\r\n",m_Verify);
    pFileFile = HttpOpenRequest(pFileHc,"POST",m_SmallBuf,NULL,NULL,NULL,
     INTERNET_FLAG_PRAGMA_NOCACHE|
     INTERNET_FLAG_KEEP_CONNECTION,
     NULL );
    if(pFileFile == NULL)
    {
    CleanFileHandle();
    return FALSE;
    }//发送的数据
    char m_Data[] = "wetertertertert";
    //请求连接
    if(!HttpSendRequest(pFileFile,NULL,0,m_Data,strlen(m_Data)))
    {
    CleanFileHandle();
    return FALSE;
    }
      

  4.   

    谢谢各位的回答
       上面的代码可以post数据,我想Post整个或多个二进制文件,服务端用标准的文件上传组件接受
    单是上面的代码好象还不行,希望各为指点
      

  5.   

    去看看http1.1的RFC吧,手组http报文了,特麻烦