110,561
社区成员
发帖
与我相关
我的任务
分享
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create("http://192.168.1.1/mtest2/FileUpload");
httpReq.Method = "POST";
//对发送的数据不使用缓存
httpReq.AllowWriteStreamBuffering = false;
//设置获得响应的超时时间(600秒)
httpReq.Timeout = 60000;
httpReq.ContentType = "multipart/form-data; boundary=" + strBoundary;
long length = fs.Length + postHeaderBytes.Length + boundaryBytes.Length;
//MessageBox.Show(length.ToString());
long fileLength = fs.Length;
httpReq.SendChunked = true;
//httpReq.ContentLength = length;