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

  • Home
  • SEARCH
  • 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 8463165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:23:28+00:00 2026-06-10T14:23:28+00:00

In mvc3 application, Product has properties as ImagePath1, ImagePath2, ImagePath3, ImagePath4 and ImagePath5 in

  • 0

In mvc3 application, Product has properties as ImagePath1, ImagePath2, ImagePath3, ImagePath4 and ImagePath5 in string type.
I can save 1 image in this rule.
For 1 image, in the controller:

public ActionResult Create( Product product, HttpPostedFileBase file )
{
       var filename = Path.GetFileName( file.FileName );
       var path = Path.Combine( Server.MapPath( "~/UploadFolder/Products" ), filename );
       file.SaveAs( path );
       product.ImagePath1 = filename;
       db.Products.AddObject( product );
       db.SaveChanges();
}

I have file upload sample as:

<script type="text/javascript">
    function HandleFileButtonClick() {
        document.frmUpload.myFile.click();
        document.frmUpload.txtFakeText.value = document.frmUpload.myFile.value;
    }
</script>
<form name="frmUpload">
<input type="file" name="myFile" style="display: none;">
<input type="text" name="txtFakeText" readonly="true">
<input type="button" onclick="HandleFileButtonClick();" value="Select" class="UploadButton">
</form>

but I can not apply thit in Product’s create view.

@using ( Html.BeginForm( "Create", "Product", FormMethod.Post, new { enctype = "multipart/form-data" } ) )
{    
     @Html.TextBoxFor( m => m.Name, new { @class = "createInputStyle" } )
     ...                        
     ...// Images here...
     ...
     <input type="submit" value="Create" class="" />
}

File upload sample works outside, but when I place upload form into Create form, have problem.
How to save more images? Sorry for bad English.

  • 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-10T14:23:30+00:00Added an answer on June 10, 2026 at 2:23 pm

    Stick the following inside your Html.BeginForm() {}

    <input type='file' name='ImagePath1' /> 
    <input type='file' name='ImagePath2' /> 
    <input type='file' name='ImagePath3' /> 
    <input type='file' name='ImagePath4' /> 
    <input type='file' name='ImagePath5' />
    

    Then, on your controller, check Request.Files, which should hold these images (providing images were uploaded)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC3 application that has a custom HandleErrorAttribute so that I can
I am developing an MVC3 application in C#. The application has several projects. Since
i am creating a MVC3 application where the user can be either an Admin
I have an MVC3 application which has a reference to DLL. This DLL is
I have an MVC3 application, I know that for relative paths, I can use
I am creating application in MVC3. I have a ConferenceController which has a Create()
In mvc3 application when I create new product, I want to add it's create
I am working on asp.net mvc3 application. In this user can post data, i
I have an ASP MVC3 application that has several HttpPost ActionResult methods. During a
net mvc3 application I have a checkbox: <input type=checkbox id=daStores name=CheckBox1 onclick=filter() /> How

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.