From another thread addressing the same problem, this answer helped me get the published file to a string -
fooobar.com/questions/130355 / ...
To quote
string result = string.Empty; using (BinaryReader b = new BinaryReader(file.InputStream)) { byte[] binData = b.ReadBytes(file.ContentLength); result = System.Text.Encoding.UTF8.GetString(binData); }
Splitting a string into an array -
string[] csvData = new string[] { }; csvData = result.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);
source share