Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
when i click on choose a file for upload then a if file already uploaded then message should be display this file already exist ,,,,,,,,
Posted
Comments
[no name] 10-Feb-14 8:04am    
Please clear your questions?

1 solution

C#
string filepath = FileUpload1.PostedFile.FileName;
            string filename = Path.GetFileName(filepath);
            string ext = Path.GetExtension(filename);
            string filename1 = Path.GetFileName(FileUpload1.PostedFile.FileName);
            string dir = @"D:\Retail\";  // folder locations
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
                FileUpload1.SaveAs(dir + filename1);
            }
            else
            {
                FileUpload1.SaveAs(dir + filename1);
            }
          // Now you can add the inserted columns data here..
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900