开发者

how to allow a user to upload a spreadsheet in asp.net mvc

i want a开发者_如何学C user to have file picker and then choose a spreadsheet which will then be parsed by a controller action. are there any examples of how to do this?


This article shows how to add a file upload control on an asp.net mvc page:

http://www.hanselman.com/blog/ABackToBasicsCaseStudyImplementingHTTPFileUploadWithASPNETMVCIncludingTestsAndMocks.aspx

With this line, you get the file from request:

HttpPostedFile hpf = Request.Files[file] as HttpPostedFile;

After getting it, you can do whatever you want with it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜