Use a BinaryReader object to return a byte array from the stream like:
byte[] fileData = null;
using (var binaryReader = new BinaryReader(Request.Files[0].InputStream))
{
fileData = binaryReader.ReadBytes(Request.Files[0].ContentLength);
}
More Related Contents:
- Determine if a number can be made with prepicked numbers and times
- All possible array initialization syntaxes
- Multidimensional Array [][] vs [,] [duplicate]
- How do I clone a range of array elements to a new array?
- printing all contents of array in C#
- Why we have both jagged array and multidimensional array?
- Declare a const array
- Why do C# multidimensional arrays not implement IEnumerable?
- Best way to combine two or more byte arrays in C#
- What is the default value of a member in an array?
- c# Array.FindAllIndexOf which FindAll IndexOf
- Passing array of strings to webmethod with variable number of arguments using jQuery AJAX
- .Net Data structures: ArrayList, List, HashTable, Dictionary, SortedList, SortedDictionary — Speed, memory, and when to use each? [closed]
- Getting the index of a particular item in array
- How do I find duplicates in an array and display how many times they occurred?
- An integer array as a key for Dictionary
- JSON deserialization – Map array indices to properties with JSON.NET
- Difference between the System.Array.CopyTo() and System.Array.Clone()
- Easiest way to Rotate a List in c#
- C# Creating an array of arrays
- Are P/Invoke [In, Out] attributes optional for marshaling arrays?
- Making an indexed control array?
- string.Join on a List or other type
- What’s the best way of creating a readonly array in C#?
- Convert from Oracle’s RAW(16) to .NET’s GUID
- How to delete an array in c#?
- send byte array by HTTP POST in store app
- Looking at each combination in jagged array
- byte[] to unsigned BigInteger?
- Byte Array to Bitmap Image