1.假如你给用户的上传个数是静态的(也就是可以在前台加入几个input="file"),这种方法比较的简单.在后台只要对每个上传的图片进行保存就可以了(每个input都有id号,直接可以得到)
2.你可以让用户选定有几个图片要上传(DropDownList选择),对这个下拉框做一个事件,选择的时候出现DataGrid其中DataGrid动态的绑定input控件,提脚的时候,进行处理!
这只是思路,具体实现方式要靠你自己了~```

解决方案 »

  1.   

    思路:用一个input="file",上传它所在的整个目录下的所有文件。
      

  2.   

    你可以在客户端让 <input type=file>动态增加(点击按钮增加一个控件,个数可以无限),然后在服务端
    上传全部文件
      

  3.   

    To:5swords()
    这个比较的困难,你有没有实现过,如果有的话把代码给大伙研究一下!
    我也很需要~``
      

  4.   

    这样的效果不难,对JAVASCRIPT的要求较高,我确实实现过,有空的时候我会
    重新写一下
      

  5.   

    首先
    for(int i=1;i<=ImageNum;i++)//根据ImageNum上传文件个数参数显示多个文件上传控件
      {
    HtmlInputFile UpLoadFile = new HtmlInputFile();
    UpLoadFile.Name="upload"+i.ToString();
    UpLoadFile.ID="upload"+i.ToString();
    UploadFile.Controls.Add(UpLoadFile);//加入文件上传控件
    UploadFile.Controls.Add(new LiteralControl("<br>"));
    }然后通过
    //上传图片、flash多媒体文件
    protected void UploadImageFile(Object sender,System.EventArgs e)
    {
    //循环上传文件
    HttpFileCollection _files = HttpContext.Current.Request.Files;
    StringBuilder _message = new StringBuilder("文件上传:<br>");
    try 
    {
    for ( int _iFile=0; _iFile<=_files.Count-1;_iFile ++ ) 
    {
    HttpPostedFile _postedFile = _files[_iFile];
    string _fileName,_fileExtension;
                        _fileName = Path.GetFileName(_postedFile.FileName);
    _fileExtension = Path.GetExtension(_fileName);
    int _iFile1=_iFile+1;//文件顺序标识
    //文件名存在(无后缀名),删除该文件,以免显示冲突
    FileInfo file1 = new FileInfo(Server.MapPath("a_pic/" + UploadId+"_"+_iFile1.ToString()+".gif"));
    if(file1.Exists)
    {
    file1.Delete();
    }
    FileInfo file2 = new FileInfo(Server.MapPath("a_pic/" + UploadId+"_"+_iFile1.ToString()+".jpg"));
    if(file2.Exists)
    {
    file2.Delete();
    }
    FileInfo file3 = new FileInfo(Server.MapPath("a_pic/" + UploadId+"_"+_iFile1.ToString()+".swf"));
    if(file3.Exists)
    {
    file3.Delete();
    }
    if (_fileExtension==".gif"||_fileExtension==".GIF"||_fileExtension==".jpg" ||_fileExtension==".JPG"||_fileExtension==".swf"||_fileExtension==".SWF" ) 
    {
    //保存文件
        _postedFile.SaveAs(HttpContext.Current.Request.MapPath("a_pic/")+UploadId+"_"+_iFile1.ToString()+_fileExtension);
    _message.Append(_fileName + "已上传至服务器,当前文件名为:"+UploadId+"_"+_iFile1.ToString()+_fileExtension+"<BR>");
    }
    else  if(_fileExtension=="")
    continue;
    else
    {
    _message.Append(_fileName + " <font color=\"red\">失败,文件格式不对,只允许gif/jpg/swf格式!</font> <BR>");
    }
    }
    Label LabelInfo=new Label();
    LabelInfo.Text = _message.ToString();
    UploadFile.Controls.Add(new LiteralControl("<br>"));
    UploadFile.Controls.Add(LabelInfo);
    UploadFile.Visible=true;
    UploadBtn.Visible=false;
    }
    catch ( System.Exception Ex ) 

    Label LabelInfo=new Label();
    LabelInfo.Text = Ex.Message ;
    UploadFile.Controls.Add(new LiteralControl("<br>"));
    UploadFile.Controls.Add(LabelInfo);
    UploadFile.Visible=true;
    UploadBtn.Visible=false;
    }
    }
      

  6.   

    int count=4096,numBytes;
    byte[] bytes = new byte[count];
    string imgFilename,imgUrl,imgPath,imglocalpath,saveLocation;
    Stream myStream;
    imglocalpath = Path.GetDirectoryName(upLoadFile.PostedFile.FileName.ToLower());
    DirectoryInfo dir= new DirectoryInfo(imglocalpath);
    FileStream fs;
    foreach(FileInfo f in dir.GetFiles())
    {
    imgFilename = f.Name;
    myStream = File.OpenRead(imglocalpath+"\\"+imgFilename);
    imgPath = Server.MapPath(getmypath());
    if( !Directory.Exists(imgPath)) Directory.CreateDirectory(imgPath);
    saveLocation = imgPath + "\\" + imgFilename;
    fs = new FileStream(saveLocation,FileMode.Create);
    while((numBytes = myStream.Read(bytes,0,count)) > 0)
    fs.Write(bytes,0,numBytes);
    myStream.Close();
    fs.Close();
    }//这个东东需要目录的权限,如果客户端是2000就设一个目录和必要的权限,再把文件拷进来就可以上传。
    //如果是98,好象不行。这个可能要做postedfile的工作,我想很难。可能还是做98的工作比较容易。
      

  7.   

    用ftp上传而后整理到数据库里面不是更好吗?