Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8428051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:56:52+00:00 2026-06-10T04:56:52+00:00

I currently have a form with multiple file inputs: Resume: <input type=file id=resume name

  • 0

I currently have a form with multiple file inputs:

Resume: <input type="file" id="resume" name ="files" /><br />
Cover Letter: <input type="file" id="coverLetter" name ="files" /><br />

and in my back end:

[HttpPost]
public ActionResult Apply(ApplyModel form, List<HttpPostedFileBase> files) 
{
    if (!ModelState.IsValid)
    {
        return View(form);
    }
    else if (files.All( x => x == null))
    {
       ModelState.AddModelError("Files", "Missing Files");
       return View(form);
    }
    else
    {
        foreach (var file in files)
        {
            if (file.ContentLength > 0)
             {
                var fileName = Path.GetFileName(file.FileName);
                var path = Path.Combine(Server.MapPath("~/uploads"), fileName);
                file.SaveAs(path);
                <!--- HERE -->
            }
        }
    }
}

My question is how do I determine if the file is from id resume or coverLetter in the spot at the commented HERE.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:56:54+00:00Added an answer on June 10, 2026 at 4:56 am

    You can’t identify it. You need to use different names:

    Resume: <input type="file" id="resume" name="coverLetter" /><br />
    Cover Letter: <input type="file" id="coverLetter" name="resume" /><br />
    

    and then:

    [HttpPost]
    public ActionResult Apply(ApplyModel form, HttpPostedFileBase coverLetter, HttpPostedFileBase resume)
    {
        ... now you know how to identify the cover letter and the resume
    }
    

    and to avoid lots of action parameters use a view model:

    public class ApplicationViewModel
    {
        public ApplyModel Form { get; set; }
        public HttpPostedFileBase CoverLetter { get; set; }
        public HttpPostedFileBase Resume { get; set; }
    }
    

    and then:

    [HttpPost]
    public ActionResult Apply(ApplicationViewModel model)
    {
        ... now you know how to identify the cover letter and the resume
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a form with inputs and name attributes. I'm able to get
I have a form in HTML with multiple inputs of type submit: <form id
Currently I have two pages: The first page contains an input form, and the
I have a php form where multiple images care uploaded. The file names are
I currently have multiple search fields within one form which the user can pick
Currently I have a functioning code for dynamically adding and removing form inputs on
I currently have an application that spawns multiple instances of a single win form.
I have my html5 form working to upload multiple mp3 files with one submit
so I have a form that I have multiple input text fields as well
I have been working on a contact form that allows multiple file attachments using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.