ASP.Net 从 jQuery 选择多个文件后上传
我使用了 jQuery 多文件上传控件 [来自 fyneworks 的 MultiFile http: //www.fyneworks.com/jquery/multiple-file-upload/#tab-Overview ] 收集一些文件名,但无法弄清楚如何将它们上传到服务器上。
标准的 asp:FileUpload 控件似乎只允许单个文件,我不想使用 swfupload 控件,只是普通的旧 aspx。
I have used a jQuery multiple file upload control [ MultiFile from fyneworks http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Overview ] to collect some filenames but can't work out how to upload them on the server.
The standard asp:FileUpload control only seems to allow single files and I don't want to use the swfupload control, just plain old aspx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(我自己回答了这个问题,我只是在通过 goole 或 SO 找到答案时遇到问题,它似乎很有用......)
这段代码适用于我需要的东西,感谢 Suprotim Agarwal http://www.dotnetcurry.com/ShowArticle.aspx?ID=68
使用合适的 jQuery 倍数选择文件后上传控件(例如来自 fyneworks 的 MultiFile http://www.fyneworks.com /jquery/multiple-file-upload/#tab-Overview)
并且已经点击了提交按钮,在aspx文件中调用以下代码
(I have answered this question myself, I just had problems finding the answer via goole or SO and it seems useful ...)
This code works for what I need, thanks to Suprotim Agarwal http://www.dotnetcurry.com/ShowArticle.aspx?ID=68
Once the files have been chosen using a suitable jQuery multiple upload control (eg MultiFile from fyneworks http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Overview)
and the submit button has been clicked, call the following code in the aspx file
HttpFileCollection 上传 = HttpContext.Current.Request.Files;
for (int i = 0; i < uploads.Count; i++)
{
HttpFileCollection uploads = HttpContext.Current.Request.Files;
for (int i = 0; i < uploads.Count; i++)
{