C#如何向配有apache的服务器上传文件?
其中接收文件的目录已设置为“可写入”

解决方案 »

  1.   

    webClinet类不行呀,我用过了,向IIS上面上传是可以的,可是向apache服务器上传就会出现405错误
      

  2.   

    是URL写错了吧,看下是否与服务器配置的接受文件的目录对应WebClient myWebClient = new WebClient();
    byte[] responseArray = myWebClient.UploadFile("http://localhost/tmp.txt",@"C:\tmp.txt");
    string 响应 = System.Text.Encoding.ASCII.GetString(responseArray);