开发者

How to upload csv file into server memory for passing it?

开发者 https://www.devze.com 2023-03-08 02:38 出处:网络
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 re

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消