Click here to Skip to main content
15,902,492 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi geeks,

Although I tried many times and posted here, but I couldn't solve this problem.
Need to create folders inside my published application which is placed in wwwroot in IIS7. But in vain. Couldn't able to create folders and upload images in published folder.

Did I miss anything ? Also I gave permissions for write in Security menu too .
C#
string root = Server.MapPath("~");
string path = root+"\\Brands\\";
string brandname = addbrand.Text;
bool isExists = System.IO.Directory.Exists(Server.MapPath(@"~/"+path+"/"+brandname));
if (!isExists)
System.IO.Directory.CreateDirectory(Server.MapPath(@"~/" + path + "/" + brandname));
if (uploadimg.HasFile)
{
string FileName = Path.GetFileName(uploadimg.PostedFile.FileName);
uploadimg.SaveAs(@root+"/Images/" + FileName);
}


Thanks in advance
Sriram
Posted
Updated 19-Jun-14 21:30pm
v2
Comments
Prasad Avunoori 20-Jun-14 3:22am    
What is the error message you got?
Sriram Ramachandran 20-Jun-14 3:24am    
No error. I published in IIS. The folders ve not created.

1 solution

 
Share this answer
 
Comments
Sriram Ramachandran 20-Jun-14 4:22am    
I thnk its not virtual directories... Its just creating folders in my published application itself. Not new folder under wwwroot.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900