In this article, the author implements a web control that can upload multiple files at a time (only version C # is available. If you are interested, you can rewrite it with VB. NET ). The main implementation method is to use an arraylist object set to load all the local files browsed by the user, and traverse the object set during the upload.
The control has been encapsulated as a DLL and can be installed in the toolbox of Visual Studio 2003. Just drag and drop aspx and set uploadpath to save the server path.
Widget
: Http://bbs.wangxu.net/viewfile.asp? Id = 1290
The address above also needs to register for the Forum, So I uploaded another one, so I don't need to register for the Forum anymore.
Http://bbs.wangxu.net/temp/WxFilesUpload.rar
Including the original code, just create a project of the web control library and add it to it.
See
Http://www.codeproject.com/aspnet/multiuploads.asp? Forumid = 13636 & Fr = 51 & select = 1172683 & DF = 100 # xx111_83xx. Because of the write web control, the problem of simultaneous uploading by multiple users must be considered. Using the static arraylist method in the original article will certainly cause the problem that multiple users share an arraylist, I used the session storage method (the htmlinputfile control cannot be serialized, so viewstate cannot be used). I hope other users can have a better way.
Prepared by mail:
Wangxu@kostech.com.cn