Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi professionals,
i want to save image using file stream into C# windows application in Solution Explorers Folder and i also want to retrieve that image on data grid view cell click event.
i am seeking for your best appreciation...and please correct me if i am wrong.
Posted
Updated 14-Oct-12 21:59pm
v2

 
Share this answer
 
Comments
Shubh Agrahari 16-Oct-12 3:01am    
sir i don't want to save that images in database.....i think it makes database heavy....i want to save that images in root folder(bin-debug folder) or solution explorer's folder...
Sumit_Kumar_Sinha 16-Oct-12 3:30am    
The best way to uploading the image is that you can store image in solution explorer's and save image path in database.......
Shubh Agrahari 29-Oct-12 6:05am    
yes sir that's actually i want....sir i tried a lot but still i am not getting the result ....sir can u give me source code ......its the need that i want.
Try this

C#
Name = System.IO.Path.GetFileName(Uploadfile.PostedFile.FileName);
FileName = (Server.MapPath("..") + ("\\Images\\" + Name));
Uploadfile.PostedFile.SaveAs(FileName);


Uploadfile is your fileupload control ...
Images id your destination folder...
 
Share this answer
 
Comments
Shubh Agrahari 15-Oct-12 7:05am    
i think there is no such a method like Server.MapPath in c# window appllication....???
Refer the link
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