小编Use*_*686的帖子

.NET Core Web API 中的图像上传

我正在使用 .Net Core 开发 Web API,我需要允许客户端上传文件列表(主要是图像)并将它们保存到服务器。

我使用 ASP.NET Core 3.0

这是我的启动文件 Startup.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Http;


namespace ImageUplaodDemo
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services) …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-web-api postman asp.net-core

4
推荐指数
2
解决办法
2万
查看次数

标签 统计

asp.net-core ×1

asp.net-web-api ×1

c# ×1

postman ×1