同个表单里的文字信息可以顺利获取到,但是图片就不行。用IFormCollection和.Files[0]会说Index was out of range.;用IFormFile会说Object reference not set to an instance of an object.
你的文件的编码类型是什么在你file标签上一级的form里面属性加上 enctype="multipart/form-data"