The Built-in Chrome PDF Viewer does not fully load large PDF files for authenticated users.
Steps to reproduce in my environment:
- In Visual Studio 2019 create a new
WebForms
project withIndividual User Accounts
authentication - In
solution explorer
create some folder e.g.MyPDFs
and put inside some large pdf file. Secure this folder with
web.config
:<location path="MyPDFs"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location>
and for this testing purposes set
runAllManagedModulesForAllRequests
totrue
:<modules runAllManagedModulesForAllRequests="true">
Run this site with IISExpress and navigate to
~/MyPDFs/A17_FlightPlan.pdf
in my case it ishttps://localhost:44302/pdfs/A17_FlightPlan.pdf
The login screen appears, after user successful logins the pdf is partially rendered (only first page) by built-in Chrome PDF viewer (pdfium)
When you remove authorization rule from
web.config
, or you put the PDF file to some other location, it is loaded correctlyThe same behavior I can reproduce on production - Full IIS
Other browsers work fine: FireFox, EDGE, or even Chrome with replaced built-in PDF viewer for Adobe Acrobat reader extension
Where could be the problem? Are the headers OK?