ASP.net - 多上传与jQuery多文件上传插件 [英] ASP.net - Multiple Upload with jQuery Multiple File Upload Plugin

查看:234
本文介绍了ASP.net - 多上传与jQuery多文件上传插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何与ASP.net的FileUpload控件上传

I know how to upload with ASP.net's FileUpload control.

我想要做的就是使用这个jQuery多文件上传插件上传多个文件。

What I want to do is use this jQuery Multiple File Upload Plugin to upload multiple files.

下面到底是什么,当选择了多个文件上传它:

Here is exactly what it does when multiple files are selected for upload:

<input type="file class="multi MultiFile" id="MultiFile1_F3" name="file1[]" style="position: absolute; top: -3000px;">


但我无法弄清楚如何从asp.net处理这些文件。
我曾尝试使用Request.Files如下链接指示:
<一href=\"http://stackoverflow.com/questions/363286/asp-net-upload-of-multiple-files-after-choosing-them-from-jquery\">http://stackoverflow.com/questions/363286/asp-net-upload-of-multiple-files-after-choosing-them-from-jquery

But I cannot figure out how to manipulate these files from asp.net. I have tried using Request.Files as the following link instructs: http://stackoverflow.com/questions/363286/asp-net-upload-of-multiple-files-after-choosing-them-from-jquery

这是行不通的。我认为,只对标记=服务器控制在编译时。

That doesn't work. I think that only works for controls marked with runat="server" at compile time.

有谁知道如何做到这一点?也许东西的Request.Form ...?

Does anyone know how to do this? Maybe something in Request.Form...?

感谢您的帮助!

推荐答案

这是一个有点,因为我没有那种在.NET中的事,但一旦你开始动态克隆形式的投入,我认为你必须走出去,请.FORM和手动查找提交的值。我写了jQuery的code克隆一些(非文件)顺序标识符输入<一个href=\"http://www.thosecleverkids.com/blog/2007/12/11/clone-table-rows-with-form-elements-in-a-net-style/\"相对=nofollow>此处。只要你有独特的标识符,可以运行一个循环来看看的Request.Form [MultiFile1_F+计数器]存在,并且从那里。

It's been a bit since I did that kind of thing in .NET, but once you begin cloning form inputs dynamically, I think you have to go out to Request.Form and find the submitted values manually. I wrote up the jQuery code to clone some (non-file) inputs with sequential identifiers here. As long as you have unique identifiers, you can run a loop to see if Request.Form["MultiFile1_F" + counter] exists and go from there.

这篇关于ASP.net - 多上传与jQuery多文件上传插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆