虽然很多人提过类似问题,但我还是没有得到一个有效的方法
虽然用POST可以发送数据,如何让HTTP服务器以文件方式存储呢?就是说如何完成HTTP协议的文件上传呢?
谢谢

解决方案 »

  1.   

    http://www.codeproject.com/asp/upload.asp
      

  2.   

    masterz
    我需要在VC 6中的代码
      

  3.   


    ::Quote MSDN SendRequestEx ::CString strData = “Some very long data to be POSTed here!”;
    pServer = sess.GetHttpConnection("mooseboy");
    pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST, "/isapi.dll?");
    pFile->SendRequestEx(strData.GetLength());pFile->WriteString(strData);   
    pFile->EndRequest();
      

  4.   

    不用isapi的dll配合行吗?
    只用PUT等命令
      

  5.   

    VC中镶嵌IE不行?当然,可能不符合你要求。
    为什么不能用isapi?其他的我就不懂了,不好意思。
      

  6.   

    用VC.NET的HTMLDlg可轻易实现!
    看看我在CSDN的原代码改动一下即可!
    http://www.csdn.net/cnshare/soft/15/15744.shtm
      

  7.   

    ispai.dll
    的代码呢?能给我一个吗?
    mostneed老兄
      

  8.   

    帮你找了一个,看看行不行?hReq = HttpOpenRequest (hConnect, "PUT", "/test/page.htm", ...)/*Here i am reading my local system file and copying the content into buffer, and passing that buffer to HttpSendRequest as szContent.*/HttpSendRequest (hReq, NULL, 0, szContent, lstrlen (szContent))// Below there is my code wriiten in with MFC classes.
    pServer = session. GetHttpConnection(servername,INTERNET_INVALID_PORT
    _NUMBER,username,password);pFile = pServer->OpenRequest(_T("PUT"),pathout,NULL,1,&str,NULL,0/*INTERNET_FLAG_NO_CACHE_WRITE*/);CFile F;
    if (F.Open(filepath,CFile::modeRead))//local systemfile.
    {
    DWORD length = F.GetLength();
    DbgMsg("Logical length of the file %d",length);
    char* szBuff = new char[length+1];
    UINT nRead = F.Read(szBuff,length);
    DbgMsg("No. of bytes read %d",nRead);
    if(pFile>SendRequest(NULL,0,szBuff,nRead))
    dwRet = TRUE;
    delete szBuff;
    }
      

  9.   

    http://support.microsoft.com/default.aspx?scid=KB;en-us;q184352
      

  10.   

    微软的例程我试验过,在下面一句不成功
       
    HINTERNET hRequest = HttpOpenRequest (hConnect, "PUT",
             "/filename", NULL, NULL, NULL,  0, 0);hRequest总是0,即NULL
      

  11.   

    pServer = session. GetHttpConnection(servername,INTERNET_INVALID_PORT_NUMBER,username,password);
    是不是和用户名、密码有关系呢?
      

  12.   

    mostneed,牛人!
    谢谢,小弟也有同样困惑,多谢你解决了。
      

  13.   

    ???一顶要用IIS的支持吗???QQ 63047710