Click here to Skip to main content
11,631,896 members (73,968 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
code for upload image and store into folder and database?
Posted 26-Aug-12 18:49pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try This :

 
        string path = "",file_path="",image_path="";
        path = Server.MapPath("images/");
 
        if (FileUpload1.HasFile)
        {
 
            string file_ext = System.IO.Path.GetExtension(FileUpload1.FileName);
            FileUpload1.SaveAs(path + FileUpload1.FileName + file_ext);
            image_path = "images/"+FileUpload1.FileName+ file_ext; // path for store in Database

            Apply the Insert Query with image_path
       }
 

If any query Please Post it....
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

hi,

please refer the below link,

[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 8,397
1 Sergey Alexandrovich Kryukov 8,009
2 Mika Wendelius 6,260
3 F-ES Sitecore 2,296
4 Suvendu Shekhar Giri 1,970


Advertise | Privacy | Mobile
Web04 | 2.8.150728.1 | Last Updated 27 Aug 2012
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