Reputation: 11
I need to fetch whether the image exist or not in folder path. I am using the below code:
bool isExists = System.IO.Directory.Exists(Server.MapPath(FolderPath + "Logo.png"));
But the bool variable returns false if the file exists.
Upvotes: 0
Views: 941
Reputation: 4883
Perhaps you should use File.Exists
instead.
bool isExists = System.IO.File.Exists(Server.MapPath(FolderPath + "Logo.png"));
Upvotes: 6