Hi,
I have to send an XML file to a web url with an HTTP POST. This XML file does contain an audio clip that has been converted into base64 file format. Before I send this file as an HTTP POST I have to convert this to string. When I try to convert the file to a string it gives me an exception.
I would be grateful if someone can help out in this.
Thanks
I have to send an XML file to a web url with an HTTP POST. This XML file does contain an audio clip that has been converted into base64 file format. Before I send this file as an HTTP POST I have to convert this to string. When I try to convert the file to a string it gives me an exception.
Code:
private string GetTextFromXMLFile(string filePath)
{
try
{
StreamReader streamReader = new StreamReader (filePath);
string returnDataStream = streamReader.ReadToEnd();
streamReader.Close();
return returnDataStream;
}
catch (Exception ex)
{
Response.Write(ex.Message);
return null;
}
}
Thanks