TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sriram Ramachandran
NA
6
2.4k
Creating folders and sub-folders in IIS 7 wwwroot using C#
Jun 18 2014 1:39 AM
Hi Geeks,
I got a requirement that to create folders and sub-folders in c# which works fine in Local machine. But when I publish that code and pasted in IIS 7 wwwroot, the folders are not creating. I should create as many folders as per requirements in the folder of IIS7 wwwroot. Here is my code which works fine in creating folders in Local Machine.
string root = Server.MapPath("~");
string path = Path.GetDirectoryName(root);
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);
}
Did I miss anything ? Also I gave permissions for write in Security menu too .
Thanks in advance
Sriram
Reply
Answers (
0
)
Attaching Sound File In Game
How to add online shopping cart with payment gateway ?