如何从asp.net中的数据库上载和检索多个文件 [英] how to upload and retrive multiple file from database in asp.net

查看:58
本文介绍了如何从asp.net中的数据库上载和检索多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何为特定用户上传和检索单个文件
现在我想为该特定用户在数据库中上传多个文件(非强制同时上传多个文件),并且当该特定用户想要查看他/她的上传文件时,他应该能够查看他/她的所有文件.
现在我该怎么办,请帮忙.

hi ,i know how to upload and retrive a single file for a particular user
now i want to upload multiple file (not compulsory to upload many file at the same time) in database for that particular user,and when that particular user want to view his/her uploaded file he should be able to view all his/her file.
now what i should do please help.

推荐答案

无论您对单个文件执行什么操作,都需要对具有UI的多个文件执行相同的操作.代码中的额外添加将成为for循环!

可能在保存时,如果有必要,您可以考虑使用SQL事务.

此外,如果在上载时将路径保存在DB中,则绝对不是问题/额外的工作.
Whatever you do for a single file, do the same thing for multiple files with a UI. Extra addition in code would be a for-loop!

Might be at the time of saving, you might consider use of SQL transaction if it matters.

Futher, if while uploading you are saving path in DB then definitely not an issue/additional effort.


在codeproject中有很多实现Multiple File uploader的方法.您可以使用它们:

使用进度条使用Flash和ASP.NET进行多个文件上传 [
There are quite a number of implementation of Multiple File uploader in codeproject. You can use them :

Multiple File Upload With Progress Bar Using Flash and ASP.NET[^]

One thing you must keep in mind, the File Input dialog doesnot allow you to choose multiple file. So you choose either one file for each file uploader and post the file input to the server or you can use external browser plugins to do this for you.


只需在文件中添加for循环上传代码并实现Silverlight或插件来实现fil上传,
just add a for loop withb the file upload code and implement silverlight or addons to implement the fil upload,


这篇关于如何从asp.net中的数据库上载和检索多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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