Reputation: 2261
I am hosting a site on godaddy for my photos and seem to run into trouble with not being able to find the path of folder with the files. On my machine everything works fine, but when I bring it up to godaddy's server, then I get an error. Below is my code, to load the files, can someone shed a little light. Thanks.
string data = HttpContext.Current.Server.MapPath("~/Photos/thumbs");
string[] thumbPhotos = Directory.GetFiles(data);
Here is the error message that I receive. Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\SysWOW64\inetsrv\~\Photos\thumbs'.
Upvotes: 0
Views: 6884
Reputation: 2261
Just had to remove the ~ to get it to work, and change the path a little.
Upvotes: 2