The Portable Document Format (PDF) is popular on the Web to display data and files to end users, because it is a standard format that is not browser-specific. Most browsers support in-line display of PDF files, and the creators of the format, Adobe Systems, offer free PDF Reader applications. To open a PDF file in ASP, you have to use a scripting language. The default language in ASP is VBScript, which is Microsoft’s server side scripting language. The only time this language can be used on the client side is in Microsoft Internet Explorer.
Dim strPDF strPDF= "C:\myDocument.pdf" Set oFileStream = Server.CreateObject("ADODB.Stream") oFileStream.Open oFileStream.Type = 1 ‘Binary oFileStream.LoadFromFile strPDF Response.ContentType = "application/pdf" Response.AddHeader("Content-Disposition", "inline; filename=" + strPDF) Response.BinaryWrite(oFileStream.Read) oFileStream.Close Set oFileStream= Nothing Tips Writer Bio
