XmlDocument – load from string?

protected void Page_Load(object sender, EventArgs e) { XmlDocument doc = new XmlDocument(); try { string path = Server.MapPath("."); doc.Load(path+"whatever.xml"); } catch (Exception ex) { lblError.Text = ex.ToString(); return; } // Convert XML to a JSON string string JSON = XmlToJSON(doc); // Replace with \ because string is being decoded twice JSON = JSON.Replace(@"", @"\"); // … Read more

How to send zip files to ASP.NET WebApi

I’m wondering how I can send a zip file to a WebApi controller and vice versa.
The problem is that my WebApi uses json to transmit data. A zip file is not serializable, either is a stream. A string would be serializable. But there has to be an other solution than to convert the zip into a string and than send the string. That just sounds wrong.