Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "application/octet-stream"
Response.Charset = "UTF-8"
Response.AddHeader("content-disposition", "attachment; filename=" & dr("file_name"))
Response.WriteFile("D:\OLMS\" & dr("file_name"))
Response.End()
manpreet
Best Answer
2 years ago
I have an asp.net application which allows user to download PDF files. but instead of downloading it, the browser opens the file with unreadable block characters.
Download Code
I am trying to download my uploaded pdf file in my project's root directory
D:\OLMS
when I click download unreable characters opens up in browser (square characters). I think it opens up pfd file in browserUpload Code