Read Write Permissions on IIS

I have create a directory uploads in the Content directory and inside the uploads dir i create a directory at the time of creation of user account. This setup works fine on the development setup but when i publish the site on my local IIS i get a access denied error.

Access to the path 'C:\inetpub\wwwroot\Content\uploads/d1bed3b7-f9e1-486a-953a-37abc7b99dad' is denied.

I have a shared hosting environment, the question i want to ask is, will i be able to set the permissions on the shared hosting environment?

What are the alternatives?

EDIT

here is code(tnx to @Marko) for creating the directory for the user

string UserGUID = Guid.NewGuid().ToString();
string path = HostingEnvironment.MapPath(@"~/Content/uploads");
Directory.CreateDirectory(path+"/" + UserGUID);

EDIT

after changing the code the error message has improved

Access to the path 'C:\inetpub\wwwroot\Content\uploads\ab569312-c487-4a08-bf49-99f7c69303f6' is denied.

Answers


There's a problem with the path, you have the wrong slash /

C:\inetpub\wwwroot\Content\uploads--------->/<----------d1bed3b7-f9e1-486a-953a-37abc7b99dad'

As long as the \uploads\ path has writable permissions any folders/files you create within that folder should inherit permissions from the parent.

EDIT

I'm not 100% sure why it works in cassini but change your code to this (it uses Path.Combine) instead of adding a slash manually (which is actually the wrong slash).

string UserGUID = Guid.NewGuid().ToString();
string path = HostingEnvironment.MapPath(@"~/Content/uploads");
string userPath = Path.Combine(path, UserGuid);
Directory.CreateDirectory(userPath);

If all of this fails, contact your hosting provider to set writable permissions to the /uploads/ folder or use the Administration panel if you have one.


Need Your Help

How to change the voice of a TTS engine

java android text-to-speech

I want to use my own voice as a TTS voice on android, can that be done in anyway?

Errors in my haml file in a ruby on rails project

ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 haml html2haml

I'm following a tutorial to make a forum! when I wrote this code in the index.html.haml