Virtual Directory cannot Write file

Posted on 2004-11-11
Last Modified: 2006-11-17
I am using and have created an aspx application to upload photos.  For the development I just used a sub folder to the application folder on my local machine and everything works fine.  However, once I deploy the application I will need to use a virtual folder to a file server (this does not have installed and is not in any domain) to store the photos due to the overall size.

I have replaced my sub folder with a virtual folder on my local machine and when creating the virtual folder I used admin credencials, but when I now try to create and delete files I catch the following message

Logon failure: unknown user name or bad password.

If I enable directory browsing then I can browse the folders through IE.

I know this is a security thing but don't know how the aspnet account works with virtual folders located on another computer

Thanks in advance
Question by:shawl01
    1 Comment
    LVL 10

    Accepted Solution

    a very simple solution to this is to add a single line to the web.config file
    if you add the following line

    <identity impersonate="true" userName="[domain / machine name]\[username]" password="[password]"/>

    that as you may have guessed sets up impersonation. disadvantage is that you have to have the password in plain text, unless someone knows of a way not to.

    as you are not concerned with a domain you may have to put the machine name in its place or you may be able simply to exclude it, if you exclude it remove the \ afterwards.

    hope that is of some help


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 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

    21 Experts available now in Live!

    Get 1:1 Help Now