locked
IIS unable to display static file RRS feed

  • Question

  • User-1110540232 posted

    hi all,

    my website is running fine and untill recently i added a new image into the image directory. and it doesn't display to the client. when i press ctrl+f5 all the images are gone from the website. reliase that all the while i have been seeing the pic from local cache.

    i have check the MIME type, i have added the .png, jpg, .gif correctly, i have added to allow=* for image directory in web.config.

    when i type http://localhost/systemdir/images/logo.png in server it show the red X box and if in firefox it shows image http://localhost/systemdir/images/logo.png  can not be display because it contains error.

    however when i type c:\inetput\wwwroot\systemdir\images\logo.png in server it shows the image correctly.

    i restarted the IIS, click all the features related to web in the features setting, set the MIME for that directory but it still not working

    can any kind soul suggest what else can I do to solve this? had spent 8 hours on this Cry

    Thursday, August 29, 2013 8:15 PM

Answers

  • User281315223 posted

    Related Discussion of Classic and Integrated Modes

    It appears that this is a common issue and simply relates to how Classic Mode handles static content as opposed to Integrated Mode : 

    In classic mode, files are typically handled by static file handler of IIS. But in integrated mode, any managed handler of your application can process them and lead to issues if they should never touch those files.

    Therefore, you have to carefully analyze your handler mappings. Because it might not be a good idea to post your IIS settings online, you might open a support case via http://support.microsoft.com and further discuss with the support professionals.

    Related Discussion on Handler Mappings

    This discussion might be related or helpful as well.

    It mentions checking the "Handler Mappings" within IIS to see if they have an available mapping for the Image type that you are dealing with such as ".jpg, .gif or .png". The poster appears to solve their issue by removing a web.config file that was present within their static images directory.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 30, 2013 8:25 AM

All replies

  • User-1716253493 posted

    try use this address in image url

    src="images/logo.png" or

    ImageUrl="~/images/logo.png"

    Dont forget enable static content

    http://weblogs.asp.net/anasghanem/archive/2008/05/23/don-t-forget-to-check-quot-static-content-service-quot-in-iis7-installation.aspx

    Thursday, August 29, 2013 8:21 PM
  • User-1110540232 posted

    hi oned,

    i have done all above. and result the the same. i can't see the pic. any other possibility?

    Thursday, August 29, 2013 9:08 PM
  • User-1716253493 posted

    you cannot use localhost as address in client machine, try use ip address

    http://<ip>/images/logo.png or http://<ip>/systemfir/images/logo.png

    Can you show your IMG or Image ASPX code?

    Thursday, August 29, 2013 9:24 PM
  • User-1110540232 posted

    tried w IP but not working too.

    below is the code:

    <td rowspan="6" style="text-align: right">
                                    <dx:ASPxObjectContainer ID="ASPxObjectContainer1" runat="server" ObjectType="Image" ObjectUrl="~/admin/login.png">
                                        <BackgroundImage VerticalPosition="center" />
                                    </dx:ASPxObjectContainer>
                                </td>

    Thursday, August 29, 2013 10:02 PM
  • User-37275327 posted

    Check file/folder permission. Go for "Everyone" for testing.

    Friday, August 30, 2013 12:13 AM
  • User281315223 posted

    These issues can be incredibly tricky to troubleshoot and most commonly require permissions changes.

    You'll likely need to go into IIS and check the Permissions on the ApplicationPool where this application is currently residing. I would recommend going through the lists of users under this Application Pool where this specific Application is running and try adding the appropriate permissions for IIS_USERS and / or NETWORK_SERVICE (or similarly named depending on your version of IIS).

    You can find a few examples of this process below : 

    There are a variety of other issues that could be at work here, such as URL Mappings / Rewriting, MIME Settings within your configuration files, permissions (as previously mentioned) etc. 

    Friday, August 30, 2013 12:30 AM
  • User-1110540232 posted

    we manage to display the static image by setting the pipeline mode from integrated to classic.

    any idea why this happen? i am using IIS 8. i believe we should use integrated mode instead of classic.

    do i need to add anything in webconfig file etc?

    Friday, August 30, 2013 4:13 AM
  • User-37275327 posted

    Not sure exactly what's behind scene. Suspecting Server updates. Check for latest updates installed.

    Friday, August 30, 2013 5:28 AM
  • User281315223 posted

    Related Discussion of Classic and Integrated Modes

    It appears that this is a common issue and simply relates to how Classic Mode handles static content as opposed to Integrated Mode : 

    In classic mode, files are typically handled by static file handler of IIS. But in integrated mode, any managed handler of your application can process them and lead to issues if they should never touch those files.

    Therefore, you have to carefully analyze your handler mappings. Because it might not be a good idea to post your IIS settings online, you might open a support case via http://support.microsoft.com and further discuss with the support professionals.

    Related Discussion on Handler Mappings

    This discussion might be related or helpful as well.

    It mentions checking the "Handler Mappings" within IIS to see if they have an available mapping for the Image type that you are dealing with such as ".jpg, .gif or .png". The poster appears to solve their issue by removing a web.config file that was present within their static images directory.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 30, 2013 8:25 AM