I want to write the contents of one docx file to another using "FILESTREAM AND STREAM" OBJECT
Here is my code
HttpWebResponse r = (HttpWebResponse)w.GetResponse();
Stream objStream = r.GetResponseStream();
using (FileStream objStr = new FileStream(@"E:\downloads\test.docx", FileMode.Create))
{
Stream str = r.GetResponseStream();
if (str != null)
{
byte[] read = new byte[256];
long count = str.Read(read, 0, 256);
while (count > 0)
{
objStr.Write(read, 0, Convert.ToInt32(count));
count = str.Read(read, 0, 256);
}
}
str.close();
}
Loading

Sibeesh VenuRank #27 · 42.9K reputationPosted Apr 28, 2015, 12:32 AM EDT
So is that working? Are you getting any errors ? Please explain your question, In the meanwhile you can check the below link.
http://www.codeproject.com/Articles/660478/Csharp-Create-and-Manipulate-Word-Documents-Progra
Please up vote and accept if it helps you.
Kindest Regards
Sibeesh Venu
www.sibeeshpassion.com
Raghavendra Joshi30 reputationPosted Apr 28, 2015, 3:11 AM EDT
Sibeesh VenuRank #27 · 42.9K reputationPosted Apr 29, 2015, 1:40 AM EDT
Please try the below link.
byte[] myData; using (var webResponse = req.GetResponse()) { var responseStream = webResponse.GetResponseStream(); myData = ReadFully(responseStream); // done with the stream now, dispose of it } // Do whatever you need with the response string responseString = Encoding.ASCII.GetString(myData);http://stackoverflow.com/questions/17844929/exceptionthe-request-was-aborted-the-connection-was-closed-unexpectedly-when
Please up vote and accept if it helps you.
Kindest Regards
Sibeesh Venu
www.sibeeshpassion.com