I have a file upload which uploads a file and gets read into a byte array.int FileLength = File1.PostedFile.ContentLength;
if (File1.PostedFile != null && File1.HasFile)
Stream fStream = File1.PostedFile.InputStream;
byte contents = new byte[fStream.Length];
fStream.Read(contents, 0, (int)fStream.Length);
The problem is, the fStream.Read seems to have a problem reading the stream. When I debug it, and the value of "contents" appears to be empty. The file gets uploaded as a corrupted file.
View Complete Post