Stream myStream1 = new MemoryStream();
// Get the length of the file.
fileLen = FileUpload1.PostedFile.ContentLength;
// Create a byte array to hold the contents of the file.
Byte Input = new Byte[fileLen];
UnicodeEncoding uniEncoding = new UnicodeEncoding();
// Initialize the stream to read the uploaded file.
myStream = FileUpload1.FileContent;
// Read the file into the byte array.
myStream.Read(Input, 0, fileLen);
string value = ASCIIEncoding.ASCII.GetString(Input);
using (StreamWriter sw = new StreamWriter(myStream1, uniEncoding))
//MyStream1 will be final output
1 Replies - 119 Views - Last Post: 05 October 2012 - 01:03 PM
Replies To: convert uploaded file into stream...is this right way ?
Page 1 of 1