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:
You need to map the physical directory path using Server.MapPath Method.
On the web server you can't create a directory or file outside your website
virtual directory
folder.Where you have the path variable, have you tried:
What is the format of path?