Click here to Skip to main content
15,924,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
code for upload image and store into folder and database?
Posted

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....
 
Share this answer
 
hi,

please refer the below link,

[^]
 
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