Click here to Skip to main content
12,076,925 members (45,085 online)
Rate this:
 
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 19: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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160212.1 | Last Updated 27 Aug 2012
Copyright © CodeProject, 1999-2016
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