string sFileName="C:\xxx.txt";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(sFileName,System.Text.Encoding.UTF8));
Response.WriteFile(filePath);
Response.End();
Response.AppendHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(sFileName,System.Text.Encoding.UTF8));
Response.WriteFile(filePath);
Response.End();
Response.ContentType = "application/ms-word"
Response.Charset = "UTF-8"
Response.AddHeader("content-disposition", "attachment; filename= " & HttpUtility.UrlEncode(name) & ".doc") Dim sourceFile As IO.FileStream = New IO.FileStream("F:\downloadexample.doc", IO.FileMode.Open)
Dim FileSize As Long
FileSize = sourceFile.Length
Dim getContent() As Byte = New Byte(FileSize) {} sourceFile.Read(getContent, 0, sourceFile.Length)
Response.BinaryWrite(getContent)
sourceFile.Close()