网页上面的下载功能怎么实现的啊,可以选择路径和有进度条的那种

解决方案 »

  1.   

    你点页面上的连接,浏览器自然就让你选择路径、然后自然就出现下载进度条了。学点基本的html标签吧。这类问题。
      

  2.   

    连接 -->  链接<a>
      

  3.   

    后台
     FileInfo fi = new FileInfo(文件路径);
            if (fi.Exists)
            {
                Response.Clear();
                Response.ClearHeaders();
                Response.Buffer = true;
                Response.AddHeader("Content-Length", fi.Length.ToString());
                Response.ContentType = "application/application/octet-stream";
                Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fi.Name));
                Response.WriteFile(fi.FullName);
                Response.End();
                Response.Flush();
                Response.Clear();
            }