我有一个应该接收文件上传的webapi。
一般定义为:
[Route("/{rdmId}/files/{fileName}")]
public class RDMFilesController : Controller
{
/// <summary>
/// Creates a new file for the given RDM. If the file already exists an error is returned.
/// </summary>
/// <returns></returns>
[HttpPut]
public async Task<IActionResult> PUT(string rdmId, string fileName, [FromForm]IFormFile file)
{
// DO STUFF
}
}
在“执行任务”部分上,如果选中,file
则为null。但是,如果您检查Request.Form.Files[0]
文件在那里!
我究竟做错了什么?我原以为file
会有这个...
编辑1:到目前为止,客户端是本教程之后的邮递员
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句