我正在编写控制器来复制FileStream
内容,我在下面的行中收到错误The Client Disconnected
,
await Request.Content.CopyToAsync(fs);
可能是什么原因?
public async Task<IHttpActionResult> Post()
{
try
{
string path = @"C:\Test";
using (FileStream fs = new FileStream(path, FileMode.CreateNew, FileAccess.Write))
{
await Request.Content.CopyToAsync(fs);
}
return Ok<bool>(true);
}
catch (Exception ex)
{
throw ex;
}
}