Dim objFile As System.IO.FileInfo
objFile = New System.IO.FileInfo(Server.MapPath("~/file.pdf"))
Response.Clear()
Response.AddHeader("Content-Length", objFile.Length.ToString())
Response.AddHeader("Content-Disposition", "attachment;filename=file.pdf")
Response.AddHeader("Content-Length", objFile.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.WriteFile(objFile.FullName)
Response.Flush()
Response.End()
No comments:
Post a Comment