orbit
orbit

Reputation: 1306

Alternative of HttpPostedFileBase in asp.net core and name of namespace

I want to design a class that have HttpPostedFileBase based property like,

public HttpPostedFileBase picture;

I am using IFormFile and using Microsoft.AspNet.Http;

the Code looks like this:

using Microsoft.AspNet.Http;

namespace design.Model
{
    public class gallery
    {
        public IFormFile picture;
    }
}

and it gives an error at using Microsoft.AspNet.Http line. How can this be solved?

Upvotes: 4

Views: 13918

Answers (2)

Shamseer K
Shamseer K

Reputation: 5301

Instead of HttpFileBase, you've to use IFormFile from Microsoft.AspNetCore.Http (install NuGet package if you haven't.)

Upvotes: 7

Shadman Sakib
Shadman Sakib

Reputation: 66

Install Microsoft.AspNetCore.Http from NuGet Package Manager.

Upvotes: 2

Related Questions