Closed bieshaoxiong closed 3 years ago
.net 我也不会用,等社区的小伙伴帮你把
<ProFormUploadButton name="file" fieldProps={{ name: 'file' }} action="/api/api/upload" />
< ProFormUploadButton name = "file" fieldProps = { { name : 'file' } } action = "/api/api/upload" / >
奇怪
还没整明白是前端写错了 还是后端写错了
看起来跟你用的framework有关系,你得慢慢找原因了 https://stackoverflow.com/questions/46294091/how-do-you-do-file-upload-method-in-appservices-for-aspnetboilerplate
🧐 问题描述
前端可以正常访问到后端接口,但是后端怎么接收不到文件
💻 示例代码
前端 : <ProFormUploadButton name="upload" label={props.uploadLabel} max={1} fieldProps={{ name: 'file', }} action="/api/ProjectManagement/products/ReceiveFile" />
后端 [HttpPost] [Route("ReceiveFile")] public AntProResultDto ReceiveFile()
{
var files = Request.Form.Files;
var headers = Request.Headers;
var CurrentContext = HttpContext; }
🚑 其他信息