实现功能:将员工照片(已经上传到服务器)批量下载到客户端一个指定的文件夹下。
要求:1、不要将文件压缩成(.rar或者.zip)文件
      2、最好没有下载提示(相当于将数据导出到本地,有下载提示比较恶心)最好有代码

解决方案 »

  1.   

    这不就是迅雷批量下载吗,下载类型是*.jpg之类的。
      

  2.   

    ftpwebrequest下载文件
    用程序根据遍历的结果生成一个.zip文件
      

  3.   

    遍历文件夹
    public static void DownLoadFile( string filepath )
      {
      string str = HttpContext.Current.Request.ServerVariables[ "APPL_PHYSICAL_PATH" ];
      string path = str + filepath;
      FileInfo file = new FileInfo( path );
      HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding( "UTF-8" ); //解决中文乱码
      HttpContext.Current.Response.AddHeader( "Content-Disposition", "attachment; filename=" + HttpContext.Current.Server.UrlEncode( file.Name ) ); //解决中文文件名乱码   
      HttpContext.Current.Response.AddHeader( "Content-length", file.Length.ToString() );
      HttpContext.Current.Response.ContentType = "appliction/octet-stream";
      HttpContext.Current.Response.WriteFile( file.FullName );
      HttpContext.Current.Response.End();
      }