开发者

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

开发者 https://www.devze.com 2022-12-13 21:48 出处:网络
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

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

精彩评论

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