Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please can u help me sir to store and retreive an image in using asp.net with c#
Posted

 
Share this answer
 
Hi,

Check this article in codeproject for your requirement.

http://www.codeproject.com/KB/aspnet/Image_to_Xml_File.aspx


All the Best
 
Share this answer
 
Hi,

Here 'm proving some code for storing any file in server side using c#

C#
   if(FileUpload1.HasFile)
{
        string ext=Path.GetExtension(FileUpload1.FileName);
                if (ext == ".jpg" || ext == "png")
                {
 FileUpload1.saveas(server.Mappath("~/Images")+"/"+FileUpload1.FileName);
                }
   
    
}


By using above code you can save any file in Images folder.You can add another file extenssions also.

And retrieving process is also same as storing.

code is
C#
Image1.ImageUrl=Server.MapPath("~/Images/"+filename);


In the above code you can give image name as filename whatever you want to retrieve.


All the Best
 
Share this answer
 
Comments
Kishore Jangid 21-Sep-11 6:40am    
He asked to store the file in xml format...
Muralikrishna8811 21-Sep-11 6:46am    
frst see question clearly

and one more thing is there is no way to store image in xml format

we can store image in xml file .
Muralikrishna8811 21-Sep-11 6:48am    
You want to perform operations on xml file check these links

http://www.codeproject.com/KB/XML/genericxml.aspx
http://www.codeproject.com/KB/cpp/XMLReadWrite.aspx

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