使用ListBox上传一个或多个文件 [英] Upload One or More than one file using ListBox

查看:89
本文介绍了使用ListBox上传一个或多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我编写代码,使我可以将多个文件附加或上传到我网站的列表框中吗?用户完成添加到列表框后,应该执行用于上传文件的代码,以上传列表框中的附件.

Could someone help me writing the code that allows me to attach or upload more than one file to a listbox in my website? After the user finishes adding to the listbox, the code for uploading the files should be executed, to upload the attached files that are in the listbox.

推荐答案

让我先阐明我对您的了解.

您需要一次上传多个文件.您需要页面上ListBox控件中的文件名.最后,用户可以单击保存",并将文件上传到服务器.
如果这是您需要的内容,请进一步阅读.

ASP.NET具有文件上传控制 [上传多个文件asp.net [
Let me first clarify about my understanding of your scenario with you.

You need to upload multiple files at a time. You need name of the files in a ListBox control on the page. And finally user can click save and files should be uploaded to the server.
If this is what you need, read further.

ASP.NET has FileUpload Control[^] for uploading files to the web server. You will need to place multiple controls for multiple upload at a time. The above link discusses how to do it. For more examples here is the Google search link - uploading multiple files asp.net[^]

Now about getting the file name in ListBox part -

Add an onblur event to all the FileUpload control and call a JavaScript function which gets the name of the file and add it to the ListBox. Again a lot of examples are available on the web. Try! :thumbsup:


这篇关于使用ListBox上传一个或多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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