Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access Denied from writing on server.

Posted on 2012-04-10
18
258 Views
Last Modified: 2012-04-15
Dear all,

I wrote a webpage which recieve a parameter from windows application and create a directory with the name of this directory on the server.

However when trying to create it, a deny message aappears.

How to fix this?
AccessIsDenied
Thx in advanced.
0
Comment
Question by:hassanayoub85
  • 10
  • 7
18 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37830486
It tells you in the error what you need to do. You need to give ASP.NET permission to access the folder on the server. Alternately, you could move the folder so it is inside the application where ASP.NET already has rights. Granting access is a matter of right-clicking the folder, choose Security and add the proper account and give Modify rights. The error tells you what account to add depending on your IIS version.
0
 

Author Comment

by:hassanayoub85
ID: 37830503
But there is no ASP.NET user!!!
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37830536
It depends on your version of IIS (see the error). ASP.NET only exists as a user on systems with IIS 5. On IIS 6 and 7 it's Network Service.

Look for articles online to cover you specific IIS version. Here's an example:

http://www.codeproject.com/Articles/18072/Allow-your-ASP-NET-to-Access-your-Resources
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:hassanayoub85
ID: 37830551
I have WinServer2008R2 with IIS7.5.
Network Service account have full privileges, even though the error still appears!!!
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37830628
Look at this article. It is specific for IIS 7.5 and concerns the DefaultAppPool account.

http://devonenote.com/2010/09/grant-permission-to-defaultapppool-identity/
0
 

Author Comment

by:hassanayoub85
ID: 37830654
Added "IIS AppPool\DefaultAppPool" but still the same.
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37830720
I'm running out of ideas.
The path to the directory in the error seems odd. I would expect a complete path to show. Is the Logs directory outside of the application root? This is what I have been assuming all along.
Have you tried restarting the application? Restarting IIS?
Can you temporarily move the Logs directory inside the application root and see if it works?
0
 

Author Comment

by:hassanayoub85
ID: 37830737
This is the complete path in the screenshot.
IIS restarted.
Moved to root too.
Still not working.
I am gonna get crazy.
ErrorFullPath
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37830760
You moved the Logs directory to inside the root directory "sts" and adjusted the path in the code to a relative path? If that does not work, there is something else wrong?

In your desired folder hierarchy, are directory "st" and directory "sts" both inside the "wwwroot" directory.
0
 

Author Comment

by:hassanayoub85
ID: 37830771
st and sts are the same, just trying to add characters to see if this solve the issue.
Moved to root, it works!!! So why it is not working on the directory?
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37830782
I don't know why it's not working on the "st" directory. I don't have an IIS 7.5 server to play with. If you like, you can delete this question and re-post, specifically including IIS 7.5 in the question.
0
 

Author Comment

by:hassanayoub85
ID: 37830788
No I will keep it, and thx for you.
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37830841
Okay, but I would recommend posting a new question specific to IIS 7.5 and refer back to this question so experts can see what has been tried so far. You will get faster results.
0
 

Author Comment

by:hassanayoub85
ID: 37830861
Ok, I will see, And will not forget your help when accepting the solution.
0
 
LVL 10

Expert Comment

by:Najam Uddin
ID: 37831049
Just to make sure, application is running under identity of Network service and this account has full control (not only read & write).
0
 

Author Comment

by:hassanayoub85
ID: 37831061
Yup
0
 

Accepted Solution

by:
hassanayoub85 earned 0 total points
ID: 37831212
Ive found the solution. OMG, it is the user IIS_USRS.
0
 

Author Closing Comment

by:hassanayoub85
ID: 37848058
I've found the solution myself
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Footer for each row on Gridview 2 32
Object Oriented Programming, C#, referencing, scoping. 13 69
hbo knew my windows software 4 62
"Emulate" TAB key when press Enter Key 3 45
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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