简体   繁体   English

文件在asp.net中上传多个文件(类似于gmail)

[英]File Upload multiple files in asp.net (similar to gmail)

I need suggestions with regards to the multiple file upload using File Upload control in asp.net(along with C#). 我需要有关使用asp.net(以及C#)中的“文件上载”控件进行多个文件上载的建议。

I have a File Upload Control, so i click the 'Browse' button and when i select a file from the select file dialog, i want the file to be shown as a link below the File Upload Control( somewhat similar to gmail). 我有一个文件上传控件,所以我单击“浏览”按钮,当我从“选择文件”对话框中选择一个文件时,我希望该文件显示为文件上传控件下方的链接(有点类似于gmail)。 This file should be seen such a way that it can be deleted, if i wanted to. 如果我想的话,应该看到可以删除该文件的方式。 And also i should be able to upload another file from the File Upload control. 而且我也应该能够从File Upload控件上传另一个文件。 All these files should be uploaded to a location when i use a button click event in the end. 当我最后使用按钮单击事件时,所有这些文件都应上载到某个位置。

I think i have made myself clear. 我想我已经说清楚了。 Any Suggestions are really helpful. 任何建议都非常有帮助。 Thanks. 谢谢。

After the user selects file, use client javascript to: 用户选择文件后,使用客户端javascript执行以下操作:

  1. Hide the file upload control 隐藏文件上传控件
  2. Create a link in its place 在其位置创建一个链接
  3. Create a "delete" link next to it, which will a) remove the original upload control from the page and b) remove both links created in steps 2 and 3 在其旁边创建一个“删除”链接,这将a)从页面上删除原始的上载控件,b)删除在步骤2和3中创建的两个链接
  4. Create a new file upload control and place it above the link created in step 2 创建一个新的文件上传控件,并将其放在步骤2中创建的链接上方

If you have any questions left, I will try to answer. 如果您还有任何疑问,我会尽力解答。

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

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