I am working in asp.net(C#)4.0. Before uploading an image, I want to check that if the folder in which the image has been uploaded is exists or not. If it exists, is it read
use the System.IO.DirectoryInfo class:
var di = new DirectoryInfo(folderName); if(di.Exists()) { if (di.Attributes.HasFlag(FileAttributes.ReadOnly)) { //IsReadOnly... } }