The website cannot display the page
Hi all,
I have some doubts regarding to show the PDF file into the browser.
When I open a small PDF I have successfully loaded PDF file. But when go to the large size pdf means above 100mb It displays "The website cannot display the page".
Could any one help me resolve this issue.
Thanks in advance
Code:
Response.Buffer = true
Response.Clear()
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile(filepath)
Response.ContentType = "application/pdf"
Response.AddHeader "Content-Length", objStream.Size
Response.BinaryWrite objStream.Read
Re: The website cannot display the page
You have the filepath, why not just redirect the user to the PDF directly?
Re: The website cannot display the page
I know in ASP.Net, there is a maximum file size limit of 4Mb by default. This can be overcome by setting an entry within the web.config file, however I don't personally know the equivalent routine, or if one exists for classic ASP.
I did manage to find you this however if you aren't going with/can't go with :afrog:'s suggestion there. On this Microsoft KB 812406 article, it details writing chunks of the file to the response output stream as a workaround. Though the samples are written in .Net languages, the theory and explainations still hold true for your scenario.