Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# .NET
I am using jquery.MultiFile.js to upload multiple files using fileupload control in an update panel and using trigger to postback on button click but on first click it uploads only one file and starts uploading multiple files after that below is my code
 HttpFileCollection fileCollection = Request.Files;
            for (int i = 0; i < fileCollection.Count; i++)
                HttpPostedFile uploadfile = fileCollection[i];
                string file = Path.GetFileName(uploadfile.FileName);
                string extension = Path.GetExtension(file);
                if (uploadfile.ContentLength > 0)
                    string no = Guid.NewGuid().ToString().Substring(0, 4);
                    string path = @"../Gallery/";
                    string serverpath = Server.MapPath(path);
                    string fullpath = serverpath + no + file;
                    valid += file + " saved successfully\\n";
Posted 13-Apr-13 3:56am
Edited 13-Apr-13 4:02am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Provide the UpdatePanel for file Upload control and make a PostBackTrigger for Import button.
lucky050 at 15-Apr-13 9:11am
I am already using a postback trigger for import button and its working but it uploads only one file on page load after that it starts working fine

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

  Print Answers RSS
0 OriginalGriff 690
1 Maciej Los 280
2 Suvendu Shekhar Giri 229
3 Richard Deeming 195
4 Sascha Lefévre 164
0 Sergey Alexandrovich Kryukov 9,678
1 OriginalGriff 9,135
2 Peter Leow 5,082
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 2,606

Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 15 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100