Search code examples
asp.netwindows-server-2008windows-server-2012

Access Denied to files after coping to Server 2012


I have an ASP.NET application where my client has moved from Microsoft Server 2008 R2 to Microsoft Server 2012. My application saves and removes files from a local folder that we give permissions on. This works fine, I can add and remove uploaded files with ease.

The problem is, that any of the files that were uploaded from the old Server and copied over to the new server, they get an Access Denied when IIS tries to remove it. Now, like I said I can upload and remove new files without any problems. It is the old files that were uploaded to the old server and transferred over to the new server that will give the error.

Can anyone point me in the right direction as to how we can setup the permissions on these files so they can be accessed correctly on the new server?

Thanks, Cory


Solution

  • Most likely the files where copied with old permissions. Try following on the new server:

    1. In Windows Explorer Right-mouse click on the folder that holds the files and go to Properties, Security Tab
    2. There click Advanced and Change Permissions
    3. There check the "Replace All child Object Permissions" checkbox and click Apply

    This should give all the old files the same permissions as new files.