I want to create a WCF-RESTful web service method,in which i need to upload an image(multipart-form data) along with some other information (in JSON format). This web service will be accessed by android and iPhone application to send Image and json information as
{ "description":"blah blah", "id"=123,"Comments":"blah blah" }
at the same request. My service input will be Stream,I want to read both image and the above json content from the stream itself.
StreamReader reader = new StreamReader(fileStream);
jsonData = HttpUtility.UrlDecode(reader.ReadToEnd());
byte[] buffer = new byte[10000];
int bytesRead, totalBytesRead = 0;
do
{
bytesRead = fileStream.Read(buffer, 0, buffer.Length);
totalBytesRead += bytesRead;
} while (bytesRead > 0);
How can i read the Passed JSON string from the Stream?