Click here to Skip to main content
15,910,872 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have retrieved the images from sql and displayed in the web page.
At the same time i created folder named images at runtime by using

Directory.CreateDirectory(NewDirectory);

Folder has been created, now i want to move or save all the images retrieved from sql to this folder.... how to do that....
Posted
Comments
MCY 21-Jan-14 4:40am    
is this new directory on the server or on the client computer that views the web page?
sukumari1 21-Jan-14 4:48am    
on server

 
Share this answer
 
Why would you want to do that ? You can do it with File.WriteAllBytes in the code that passes the image to the client
 
Share this answer
 
try like this:-
System.Drawing.Bitmap bmp; // your image object
			bmp.Save(Server.MapPath("~" + "/" + "Image.png"));


or
System.Drawing.Image img; // your image object
			img.Save((Server.MapPath("~" + "/" + "Image.png"));


add you crated file directory path in above code.
 
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