回覆列表
  • 1 # 脫離空間站

    string fileURL = this.Server.MapPath("你要下載的檔案路徑");//檔案路徑,可用相對路徑FileInfo fileInfo = new FileInfo(fileURL);Response.Clear();Response.AddHeader("content-disposition", "attachment;filename=" + Server.UrlEncode(fileInfo.Name.ToString()));//檔名Response.AddHeader("content-length", fileInfo.Length.ToString());//檔案大小Response.ContentType = "application/octet-stream";Response.ContentEncoding = System.Text.Encoding.Default;Response.WriteFile(fileURL);

  • 中秋節和大豐收的關聯?
  • 禾加一個卑念什麼?