soona Posted May 16, 2009 Share Posted May 16, 2009 hi,How to save uploaded images in xml file using asp.net with C# codebehind?Thanks Link to comment Share on other sites More sharing options...
aspnetguy Posted May 29, 2009 Share Posted May 29, 2009 Not sure what you mean. XML is a file format and a gif or jpg is another file format. You can't save the image as XML. Link to comment Share on other sites More sharing options...
jesh Posted May 29, 2009 Share Posted May 29, 2009 The only thing I can think of would be to serialize the image to a string and store that string in the XML, but I can't imagine that being very efficient.If that's the route you're looking for, you might check out the BinaryFormatter class.I've used the BinaryFormatter, coupled with the GZipStream, to serialize objects in the past. Link to comment Share on other sites More sharing options...
discuss97 Posted July 16, 2009 Share Posted July 16, 2009 The only thing I can think of would be to serialize the image to a string and store that string in the XML, but I can't imagine that being very efficient.If that's the route you're looking for, you might check out the BinaryFormatter class.I've used the BinaryFormatter, coupled with the GZipStream, to serialize objects in the past.You Would upload images through file upload control and save the url on database through insert sql command after that you can access datatable in xml in file in your desired format. Many function are available in asp.net for accessing datasource to xml file... Link to comment Share on other sites More sharing options...
Skemcin Posted September 28, 2009 Share Posted September 28, 2009 I think I understand what you are looking for but it isn't an efficient way to do things. I'd suggest doing one of the following:a.) upload file to the server and store (in a database) its physical location relative to your web site root address. Then when you query the database you can build a url from the result set.b.) upload file to the server and store (in an XML document) its physical location relative to your web site root address. Then when you read the XML file you can build a url from that information.Does that make sense? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.