VC如何用HTTP协议,进行文件上传。

解决方案 »

  1.   

    文件上传一般采用采用FTP较多,而HTTP用的较少,因为既慢又麻烦。
    用http可以参见
    <<使用 HttpSendRequestEx 进行大型 POST 请求>>
    http://support.microsoft.com/?kbid=177188
      

  2.   

    我原来封装了一个HTTP下载和上传的类,如果你需要的话可以留下信箱
      

  3.   

    我的是 [email protected]
      

  4.   

    我也想要,谢谢![email protected]
      

  5.   

    感觉 上传 应该是用ftp多
      

  6.   

    我也要,正在做这个,但没做出来
    [email protected]
      

  7.   

    我也要
    [email protected]
    源代码谢谢
      

  8.   

    我也要,我正在找的就是这个,谢谢了[email protected]
      

  9.   

    我也要,多谢老大
    [email protected]
      

  10.   

    看来我来的也是时候啊
    [email protected]
    3qu
      

  11.   

    谢谢!给我一份
    [email protected]
      

  12.   

    我也要一份:
    [email protected]
      

  13.   

    我也要一份:[email protected]
    谢谢
      

  14.   

    我也要一份哦 谢谢  [email protected]
      

  15.   

    >>billy145533($_$) 
    >>文件上传一般采用采用FTP较多,而HTTP用的较少,因为既慢又麻烦。
    >>用http可以参见
    >><<使用 HttpSendRequestEx 进行大型 POST 请求>>
    >>http://support.microsoft.com/?kbid=177188我下载下来试了一下,里面的asp程序有点小错误,大家用的时候注意
    <%@ LANGUAGE="VBSCRIPT" %>
    <% 
       'Increase Script Timeout to 10 hours
       Server.ScriptTimeout = 36000   'Get size of POST data
       PostSize = Request.TotalBytes   Response.Write PostSize   'Read POST data in 1K chunks
       BytesRead = 0
       For i = 1 to (PostSize/1024)
         ReadSize=1024
         PostData = Request.BinaryRead(ReadSize)
         BytesRead = BytesRead + ReadSize
       Next
       
       'Read remaining fraction of 1K
       ReadSize=TotalBytes- BytesRead
       If ReadSize <> 0 Then
         PostData = Request.BinaryRead(ReadSize)
         BytesRead = BytesRead + ReadSize
       End If   ' Send results back to client
       Response.Write BytesRead
       Response.Write " bytes were read."%>这里:   'Read remaining fraction of 1K
       ReadSize=TotalBytes- BytesRead
     TotalBytes 应该为PostSize晕 例子程序居然会弄错........
      

  16.   

    我来的不晚吧!谢谢!也给我一份![email protected]
      

  17.   

    http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx
    看看这个能否帮你