.net 6 让swagger支持上传文件

发布时间:2022-03-04 09:48:49来源:网络阅读(891)

    API代码 

    [HttpPost]
            public ApiResult<string> UpFile(List<IFormFile> files)
            {
               
                if (files.Count != 1) throw new MyException("只允许上传一个文件");
                var basePath = Path.Combine(_hostingEnvironment.WebRootPath);
                var savePath = Path.Combine(basePath, "zlfile");
                var fileName=DateTime.Now.ToFileTime();
                var file=files[0];
                var fileType=Path.GetExtension(file.FileName).ToLower();
                using (var stream = new FileStream(Path.Combine(savePath, $"{fileName}{fileType}"), FileMode.CreateNew))
                {
                    file.CopyToAsync(stream).Wait();
                }
                return Response($"/zlfile/{fileName}{fileType}");
            }

    然后再看swagger ,度娘下,就是需要增加个 IOperationFilter 来实现,看代码

    public class FileUploadOperation : IOperationFilter
    {
        public void Apply(Operation operation, OperationFilterContext context)
        {
            if (operation.OperationId.ToLower() == "apivaluesuploadpost")
            {
                operation.Parameters.Clear();
                operation.Parameters.Add(new NonBodyParameter
                {
                    Name = "uploadedFile",
                    In = "formData",
                    Description = "Upload File",
                    Required = true,
                    Type = "file"
                });
                operation.Consumes.Add("multipart/form-data");
            }
        }
    }

    然后,在services.ConfigureSwaggerGen()参数中,添加

    options.OperationFilter<FileUploadOperation>(); 

    方法的原理是通过重写操作某个特定API的的过滤器,来实现对返回内容的操作。

    由于.NET 5 自带了swagger都支持的是OpenAPI 3,这个方法不好用了。不过思想应该相同,首先看看OpenAPI 3的规范。

    文件上传需要定义为:

    requestBody:
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              fileName:
                type: string
                format: binary

    这个套路和OpenAPI 2完全不一样,需要重新设置requestBody才行。

    public class FileUploadOperation : IOperationFilter
    {
        public void Apply(OpenApiOperation operation, OperationFilterContext context)
        {
            //判断上传文件的类型,只有上传的类型是IFormCollection的才进行重写。
            if (context.ApiDescription.ActionDescriptor.Parameters.Any(w => w.ParameterType == typeof(IFormCollection)))
            {
                Dictionary<string, OpenApiSchema> schema = new Dictionary<string, OpenApiSchema>();
                schema["fileName"] = new OpenApiSchema { Description = "Select file", Type = "string", Format = "binary" };
                Dictionary<string, OpenApiMediaType> content = new Dictionary<string, OpenApiMediaType>();
                content["multipart/form-data"] = new OpenApiMediaType { Schema = new OpenApiSchema { Type = "object", Properties = schema } };
                operation.RequestBody = new OpenApiRequestBody() { Content = content };
            }
        }
    }

    执行之后,swagger已经可以正常识别了,通过选择文件即可上传,效果如下:
    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmoAAAEECAYAAACYxBjIAAAgAElEQVR4nO3dd3gU1cIG8HdmUwQFuZeSAggaBIx6BQQVLMQAliRUUToGEATBAhYQQUSkGUFFepEIAipFKQkqXQQEAiJIJEgLLSHId6/cK8hudub7Y3dmZ3ZnS0KSnSTv73nyZHfKmTOrIW9OG0GWZRlOmpc6Rtu9HVvQY4iIiIjMRBCEQh3j7bxAyvN6HSWoBRLGvL73UQHtOYWvJhEREVHx0KYbn6HKmWncj/H33m+5Pgiyg0FdZO+vNReTZdkwgLE1jYiIiEoro2Alu2+XZd17b699bfNbD0mSPBKVUUjTBjRtOCtstygRERGRmfkKW7rQpglsRR3WPIKaLphptwmC2uTns7WNiIiIqAzx22rmzEhG+643rOmCmntI03VzyrLxfrdzvb0nIiIiKi18jTtzD2GCIOjykuF+H2X7EqK88BrSNO+9BTWj4KapDUMbERERmZ7gpfdQcGYZXwFLcB2sHuv+XeGvLK0Q98qo752Vlb0ENY+Qpj1XX5jxdiIiIiKTELw0LKlBC/AavHTHO066rnCmFaJ9o1tuwy2MSZIEu12C3Z4PwFEB93Cmns811oiIiMjEAgpNXrowBfW1DIslBBaLCFEUdaFONwHTaAZpgMFNsNvtunXU3FvTlJBmtdrwt0WGZAEkhiwiIiIq50RBgGgHInbMwNVHhqphTR2z5me8WiBBzbNFzS2kybIMu13C3xYZ+aKsXxWOiIiIqJySZBmS6Hhtt0v6EAYYdoFqBdKqph+jZhDSHEEtH/khEgyWXCMiIiIq9+z2fFgsom6bURdoQceq6Wd9eulDlWWg2g2V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rQURERERuAg5qoWFhxVkPIiIiInITcFATRQ5nIyIiIipJTF9EREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJsWgRkRERGRSDGpEREREJlVmgpogH8XXiX3QOTEZD77+Hf6buw0fJvbBy+tynUdcwt5h/fHg69/hj6DWlIiIiCgwIcGuQNG4hD2vpuCD2K5YnfI4qgEIy90W7EoRERERXZcyEdQE+RLOZuWj6aB7UM25zRrZEkPTWga1XkRERETXo8x0fRIRERGVNaW+Rc2+JgVd5hx2vJk1Ap1nATUHTcKsplmY3C8VpwZNxMdJkV7PD8vdhsn9UrEDMgAgJ7ab2n1KREREFEylPqhZ2r2OlW2PYlXSRGzVhrLcLL/nKiHt1KCJWJEUCceEgxFo/zoY1oiIiCjoynHX5yXseP9zrIjtitFqi1tVxPVsjYgju/FDnhTU2hERERGV26AWlvsrfszKR9OW9+hazmzRkXhYOolT5+Wg1Y2IiIgIKANdn9frnHNcm7uaZy8CjbyPbSMiIiIqbuU+qLUYvwDDGlmCXQ0iIiIiD+W269MaeRceahCCKT9lBrsqRERERIbKbVBTJg40XztF85gpx0zQCXzMFBEREZlAue76/KtJF6wfBzw52jVOjeuoERERkVkINptNBgBZltUvSZIgOb/LkoRr16yw3RQa7LoSERERmU7N7TOR17g/wsPDIIgiRFGEKAgQRRGCIKhfADxeK7Svtcpx1yeVtJwZA9E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+oaERERUbljES0AtI1cgmucv8FcAIW/8Gb4ZAL3AiwWEWE2IERiyxoRERER4MhEIZLjtcUiFtlMT925drtdBhwtZ7KS+JyvtV+SJMFul2CX7JBlx/HKDAb1XOdrhfpa273Kh70TERGRSehClDOjeJtYqW7XDA2ziBZYLCJEUfTamma0xprh9Q2EaN8IgqCGNffTlApYZBEyoA9mvkKaGwY1IiIiMotAWsHcA5qyTYBnV6dRSCvotbVClHCm++6nEAGOwXEyNOEOcK0R4qdijkMY2IiIiCg4AuqO9PKkAQGeLW2+Znpez3Jnxi1qmlY12S10aYOZdr8utHmZlGBUeSIiIqJg89ey5v7EAffuTI8HBShZ6jrHrYUoB2uDlK8uUPdj1O/wDHXOA423ExEREZmI4OUJAt5axryNXzPqWSxsDhIkSVJr5D4hQNc6ZjBhwNeYNHZtEhERUWkVyIK1ho/b1IS0wk4g0B2rDWqO8r2EME3K9BbQGM6IiIiorPH2VAFfrWi+xqUVJKiFuG8Q3Loqtd2b2rFnRpfQnkNERERUmvkKWbLjjWOjQSuav/MDroPs4LHDZ6uZ27poRpdkWCMiIqLSyvBpTe7bvbSieTu/MOPUBCWl+QtrPt/7uLBukkKBq0dERERUvAJ+HqfBgriBvPdbrg+CtjmtIIvUBtJixlY1IiIiKm0CCVUFCWPX9Qgp935PX+GqsPuIiIiISrPCPmHgepcn8whqCraYEREREXkqbItboa7lLagpChPGGOCIiIiotCvU4P8iXuDfb1BTMHwRERERGSuuJzB5rKPmrwIMbEREREQOxf2IzICDmiLQCjHQERERUWlllmeU/z8qPkfAQ6PzZwAAAABJRU5ErkJggg==

    参考资料#


关键字

上一篇: .NET 500.19错误

下一篇: .NET 6中读取BODY内容