This Virtual Directory does not allow contents to be listed.

Posted on 2009-02-18
Last Modified: 2012-05-06
I am passing a dynamic share name to the src attribute of the img tag.  Is there a way to display images from a network share?When I run web tool Fiddler to look at the error. I see "This Virtual Directory does not allow contents to be listed."

<img src="\\sharename\folder\3769.jpg" />

Open in new window

Question by:groovypash
    LVL 5

    Accepted Solution

    I don't think that will work. What I think you want to do here is create a folder within the wwwroot folder. Point your image tags to this folder as you would any regular image reference in HTML. Then share that folder out to your users. Be careful when assigning permission though as this folder is out on the web.
    LVL 22

    Assisted Solution

    winthropj I think has the best solution.
    This might work but it would depend on how the users are accessing the page that displays the image.
    If they are accessing it from a LAN then the browser is going to pass Windows credentials to the shared folder and have to authenticate to get access to the file.  If they are on the Internet, then they would have to do the same thing but it will not work.

    All this assuming that using a share reference for an IMG statement is valid syntax.

    Author Closing Comment

    I got it working by impersonating the user to access the folders
    LVL 22

    Expert Comment

    FYI ... Impersonization is a server side coding technique;  If you are impersonating the user then you are accessing the file from the server and not embedding the tag into the HTML to be resolved on the client machine.  

    Either way, I'm glad you got it working.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now