1

I am attempting to create a web application, and I am testing it on my desktop using IIS.

My problem comes whenever I attempt to request a PNG image. The server responds with a 401 specifically for PNG images, but it responds just fine with JPEG images in the same folder.

I even ensured specifically that PNG files are allowed in the IIS Manager, as you can see in the image below:

IIS Manager Window

Here is the log file:

2015-10-04 18:32:55 127.0.0.1 GET /asteroids/resources/millenium_falcon.png - 80 - 127.0.0.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/46.0.2490.52+Safari/537.36 http://localhost/asteroids/index.html 401 3 5 0
2015-10-04 18:32:55 127.0.0.1 GET /asteroids/resources/background.jpg - 80 - 127.0.0.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/46.0.2490.52+Safari/537.36 - 304 0 0 22

Is there anything else I am not checking here? I would appreciate any help!

scottysseus
  • 427
  • 1
  • 5
  • 10
  • What do the permissions look like on the files? – Shane Madden Oct 04 '15 at 19:08
  • The system, administrators, and my user all have read/write permissions on all of the files – scottysseus Oct 04 '15 at 22:16
  • Does the IIS user have read? – Shane Madden Oct 04 '15 at 22:17
  • How do I determine who the IIS user is? There are only three entries listed in the `Groups or Username` box: `SYSTEM`, Scott (me), and administrators. I am on Windows 10 by the way – scottysseus Oct 04 '15 at 22:18
  • 1
    You get a 401.3 which means `Unauthorized due to ACL on resource.`, run `icacls.exe .\millenium_falcon.png` and compare the results with `icacls.exe .\background.jpg` The png file is missing some permissions, system, your user and administrators is not sufficient. The easiest fix would be to add read permissions to `users` assuming this is a dev workstation. On a live server you should use more specific permissions for the application pool identity. – Peter Hahndorf Oct 06 '15 at 12:04

1 Answers1

0

Your IIS_IUSRS account in Windows might not be authorized to access the png files.

Check the Security applied to the JPG files and to the PNG files as below:

File/Folder Securities for IIS_IUSRS

This is default settings, note that Read permissions are allowed and so are Read & Execute.

This is by default on my files. I haven't changed these permissions.

HTH

Ortund
  • 127
  • 7