Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 771
orbit Avatar asked Oct 15 '25 18:10

orbit


1 Answers

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

like image 106
Shamseer K Avatar answered Oct 17 '25 09:10

Shamseer K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!