I just uploaded my site to Go Daddy and have code that creates a directory dynamically based on a user id when the user creates an account on my site. It's not creating the directory so I suppose I need to set permissions in some way but I don't have control over IIS since my site's being hosted. How do I programatically set permissions?
if(Directory.Exists(path))
return true;
try
{
Directory.CreateDirectory(path);
}
You can create a file/sub directory only within the root web directory provided to your website. And GoDaddy might have provided you a login to a control panel using which you can set permissions in your directory. The following is the process to set up permissions on a godaddy account:
- Login using your user name/account number and password
- Click on My Account
- Click on Hosting Account List
- Click on Open (the web hosting package you want to open)
- Scroll down to content and click File Manager
- Select the domain folder you want to set permissions for and click permissions button on the upper control bar
- Set the required permissions and click OK.