How to upload csv file into server memory for passing it?
I have SCV file, and i want to insert records from that file in to database, i do开发者_开发百科nt wan to store/upload this file on server hard drive, i want to just parse this in memory and insert records in to database how can i do it in asp.net mvc 3.0?
Just copy it into a memory stream:
if (Request.Files.Count == 1)
{
System.IO.MemoryStream memStream = new System.IO.MemoryStream();
Request.Files[0].InputStream.CopyTo(memStream);
精彩评论