IIS 7 and Above
IIS cannot serve a PDF file when containing folder has serveral files
Last post Apr 10, 2019 06:18 AM by Able
Apr 09, 2019 01:20 PM|Dev_Jaime|LINK
This is very strange. I developed an ASP.NET web site that in some part of the code, it validates if a file exists, by mean of the following method:
That method returns false even when the file exists.
When I point the browser directly to the PDF, I got a 403 forbidden error.
Containing folder has about 81,000 files.
If I copy that PDF file to other directory, where that file is the only file there, I can point the browser there and the PDF is shown.
What may be happening here?
Apr 10, 2019 06:18 AM|Able|LINK
According to your description, 403 error means you don't have permission for this folder or IIS is denying you access to the actual folder.So I suggest that you could try as below:
Enabled directory browsing on the virtual folder of the web site.You could see as below:
Else you could add iis permission for folder which saves pdf files , you could try as below: