简体   繁体   English

在ASP.NET上上传的CSV文件

[英]csv file upload on asp.net

User need to upload 30,000 csv values, these values may contain 16 digit numbers or zipcodes. 用户需要上传30,000个CSV值,这些值可能包含16位数字或邮政编码。

Now our asp.net project doesn't use AJAX tool kit controls or jquery or any other 3rd party controls or open source code. 现在,我们的asp.net项目不再使用AJAX工具包控件或jquery或任何其他第三方控件或开源代码。 This is restriction as per companies privacy policy. 根据公司隐私政策,这是限制。

So I have to come with a best way to accommodate file upload feature. 因此,我必须提供一种最佳的方式来容纳文件上传功能。 This has to be versatile in regards to re-usability some thing like a custom control 就可重用性而言,这必须是通用的,例如自定义控件

This file upload feature should not be saved on the server, instead I need to read data into stream buffer and send them to UI then once user verify these values he/she'll have to hit submit thus values will be saved to DB. 此文件上传功能不应保存在服务器上,相反,我需要将数据读入流缓冲区并将其发送到UI,然后一旦用户验证了这些值,他/她将必须点击Submit,因此这些值将被保存到DB。

what are the best ways to implement this, 实施此方法的最佳方法是什么?

  • Can I make use of System.Net.Webclient ? 我可以使用System.Net.Webclient吗? or 要么
  • Is there any other alternative ways by using Async HttpHandlers ? 使用Async HttpHandlers还有其他方法吗?
  • Can I show file upload progress to UI ? 我可以显示文件上传到UI的进度吗?

Appreciate if you could help me with proper guidence on this. 感谢您是否可以在此方面为我提供适当的指导。

Thanks in advance krish 在此先感谢krish

Well 30,000 values of zipcode or any other 16 digit code should be uploadable normally using file control(i mean via postback). 邮编或其他16位代码的30,000个值应该可以使用文件控制正常上传(即通过回发)。

if you have to read and show 30,000 on the UI, i presume you are at risk of freezing your UI. 如果您必须在UI上阅读并显示30,000,我认为您有冻结UI的风险。

Moreover if you are not on HTML5, there is no way that you can read the content on the client side, except if you fiddle around with flash. 此外,如果您使用的不是HTML5,则无法在客户端读取内容,除非您在使用Flash时费力。

HTML 5 file api reference http://www.html5rocks.com/en/tutorials/file/filesystem/ HTML 5文件api参考http://www.html5rocks.com/zh-CN/tutorials/file/filesystem/

How to read and write files with Flash(Action script) 如何使用Flash读写文件(动作脚本)

http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/ http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM