Reza Owliaei
Reza Owliaei

Reputation: 3363

Upload many file to Many Model properties in a single page

I have to fill out following model in a view:

IEnumerable<File> Photos
IEnumerable<File> Logos
IEnumerable<File> Videos

How can send multiple files with one POST to a controller action?

Upvotes: 0

Views: 24

Answers (1)

AKD
AKD

Reputation: 3966

what about this :

    [HttpPost]
    public ActionResult Post(Class Model, IEnumerable<HttpPostedFileBase> Photos, IEnumerable<HttpPostedFileBase> Logos, IEnumerable<HttpPostedFileBase> Videos)
    { 
        // proceed 
    }

where Photos, Logos & Videos should names of ur controls (input type file)

Upvotes: 1

Related Questions