Thursday, 13 January 2022

Multiple file upload by form post ASP.NET C# MVC


Multiple file upload by form post ASP.NET C# MVC


This post will let you upload multiple image files through a single form post using the C# ASP.Net MVC platform.

Key Point

  • Upload multiple image files with a new name
  • Save a associate record and file name will be newly created record identity field value
  • No need to save the image name in the database because the file name will start with a record ID and end with a text. 
  • Best for putting student, employee documents without any hassle. 

HTML Code : 

<form method="post" enctype="multipart/form-data">

     @Html.AntiForgeryToken()

    <p class="m-0">

        Photo

        <input type="file" name="Photo" id="Photo" accept="image/x-png,image/jpeg" />

        <br />

        Adhaar

        <input type="file" name="Adhaar" id="Adhaar" accept="image/x-png,image/jpeg" />

        <br />

        Pan

        <input type="file" name="Pan" id="Pan" accept="image/x-png,image/jpeg" />

        <br />

        <input type="checkbox" id="chkconfirm" /> I provide my consent. I will follow the Tangentweb term condition and policy.

        <br /> <br />

        <input type="submit" value="Save" class="button button-primary button-wide-mobile" onclick="return filecheck()" />

    </p> 

</form>

Saturday, 11 December 2021

Find cat in Sheep

 


Next Fun

Wednesday, 8 December 2021

File compress client side by Java script before upload to server | C# ASP.Net


File compress facility is available in javascript and it's good practice to compress files client-side, before uploading to the server because it saves the resource of the Server time and internet bandwidth and increases the user file upload experience. 

Saturday, 20 November 2021

Generic List C#

 A generic list is a dynamic array-like structure used to store user information for any type of data . The list is one of the most powerful and useful data structures provided by C#. You can not imagine modern programming without a generic list because built-in programming capability makes a developer work easy. You will get some practical real-life programing practice from the list in this post.

public class Student

    {

        public string roll { get; set; }

        public string name { get; set; }

        public string city { get; set; }

    }