如何使用ajaxToolkit上传多个文件:AsyncFileUpload [英] How do I upload several files with ajaxToolkit:AsyncFileUpload
本文介绍了如何使用ajaxToolkit上传多个文件:AsyncFileUpload的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在使用它:
I have been using this:
<ajaxToolkit:AsyncFileUpload OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete" runat="server"
ID="AsyncFileUpload1" UploaderStyle="Traditional" CompleteBackColor="White" UploadingBackColor="#CCFFFF"
ThrobberID="imgLoader" OnUploadedComplete="FileUploadComplete" />
的背景代码:
with the background code:
protected void FileUploadComplete(object sender, EventArgs e)
{
string filename = System.IO.Path.GetFileName(AsyncFileUpload1.FileName);
AsyncFileUpload1.SaveAs(Server.MapPath("Uploads/") + filename);
byte[] file = new byte[AsyncFileUpload1.PostedFile.InputStream.Length];
file = ReadFile(AsyncFileUpload1.PostedFile.InputStream);
Session["File"] = file;
}
获取单个文件然后将其放入数据库并且它正在运行但是怎么做我将其更改为多文件上传?
to get a single file and then put it to a DB and it's working but how do I change this to a multiple file upload?
推荐答案
除非发生变化,否则您无法使用它上传多个文件。您需要向页面添加多个,继续重用该页面,或者获取支持多个文件上载的第三方控件。
Unless something changed, you cannot use it to upload multiple files. You either need to add several to a page, keep reusing the one, or get a 3rd party control that supports multiple file uploads.
这篇关于如何使用ajaxToolkit上传多个文件:AsyncFileUpload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文