请教:WebClient.UploadFile 的使用方法
使用WebClient.UploadFile方法往网络服务器上上传文件时出错,错误如下,请各位大虾指点一二。谢谢。
远程服务器返回错误: (405) 不允许的方法。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Net.WebException: 远程服务器返回错误: (405) 不允许的方法。
源错误:
行 177: //Response.End();
行 178: // Upload the file to the URL using the HTTP 1.0 POST.
行 179: byte[] responseArray = myWebClient.UploadFile(uriString,"POST",fileName);
行 180:
行 181: // Decode and display the response.