Access Denied from writing on server.

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.
hassanayoub85Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
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
hassanayoub85Author Commented:
But there is no ASP.NET user!!!
0
Tom BeckCommented:
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
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

hassanayoub85Author Commented:
I have WinServer2008R2 with IIS7.5.
Network Service account have full privileges, even though the error still appears!!!
0
Tom BeckCommented:
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
hassanayoub85Author Commented:
Added "IIS AppPool\DefaultAppPool" but still the same.
0
Tom BeckCommented:
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
hassanayoub85Author Commented:
This is the complete path in the screenshot.
IIS restarted.
Moved to root too.
Still not working.
I am gonna get crazy.
ErrorFullPath
0
Tom BeckCommented:
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
hassanayoub85Author Commented:
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
Tom BeckCommented:
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
hassanayoub85Author Commented:
No I will keep it, and thx for you.
0
Tom BeckCommented:
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
hassanayoub85Author Commented:
Ok, I will see, And will not forget your help when accepting the solution.
0
Najam UddinCommented:
Just to make sure, application is running under identity of Network service and this account has full control (not only read & write).
0
hassanayoub85Author Commented:
Yup
0
hassanayoub85Author Commented:
Ive found the solution. OMG, it is the user IIS_USRS.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hassanayoub85Author Commented:
I've found the solution myself
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.