Click here to Skip to main content
11,790,021 members (43,242 online)
Click here to Skip to main content

Tagged as

Multiple File Upload Using jQuery

, 23 Jan 2013 CPOL 35.4K 17
Rate this:
Please Sign up or sign in to vote.
How to select more than one file at a time


The code shown in this tip helps to select more than one file at a time. Also, we can remove selected file, can restrict file type, etc. It's easy on user friendly one.


You can refer to this link.

Using the Code

Refer to the code below:

<html >
<head runat="server">
    <title>Multiple file Upload</title>
    <script src="" 
    <script src="" 
    <form id="form1" runat="server">
        <asp:FileUpload ID="FileUploadJquery" runat="server" 
        class="multi" accept="jpg|png" />

C# code to handle fileupload control:

string fileName1 = "";
string FullName1 = "";
HttpFileCollection uploads = Request.Files;
//for (int fileCount = 0; fileCount < uploads.Count; fileCount++)
for (int fileCount = 1; fileCount < 6; fileCount++)
    if (fileCount < uploads.Count)
        HttpPostedFile uploadedFile = uploads[fileCount];
        fileName1 = Path.GetFileName(uploadedFile.FileName);
        if (uploadedFile.ContentLength > 0)
            string[] a = new string[1];
            a = uploadedFile.FileName.Split('.');
            fileName1 = a.GetValue(0).ToString() + 
            "." + a.GetValue(1).ToString();
            ("mobile_image/mob_img/" + fileName1));

The above code:

  1. Restricts the same files
  2. Restricts the number of files to be uploaded
  3. Type of files to be uploaded


Thank you.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer Sonata Software Pvt Ltd
India India
Hi.. I am Vinod Kumar B C from Mysore, Karnataka. I have done MCA and currently working as a Software Engineer having 3 Years of Experience in web development. I know, C#, MVC, Sql Server, CSS, JQuery, C, C++, HTML, DB2, DataStructures.

You may also be interested in...

Comments and Discussions

QuestionOther field data Pin
Spiff Dog21-Jan-13 7:18
memberSpiff Dog21-Jan-13 7:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1509028.1 | Last Updated 24 Jan 2013
Article Copyright 2013 by vinodkumarnie
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid