Workaround for Directory.GetDirectories on restrictive shared host
Hi, I'm trying to upload an asp.net site that I didn't write to a shared host - GoDaddy.com. Apparently because of their restrictive security policies I am unable to read subdirectories within my own site. The code it's balking on is: Directory.GetDirectories - please see below. Is there any other way to get this information or does anyone have a way around this problem? GoDaddy's technical support knows very little about asp.net and can't help.
If you don't have access to the folders, there isn't any workaround that I know of. What do you need the folder access for?
medsoos
ASKER
I think the problem is more related to GoDaddy not allowing the Directory.GetDirectories method. They only allow medium instead of full access for asp. The program builds a list of directories, subdirectories and files for users in a content management system. I think I need to switch providers.
lunadl
This is the code we use for the same behavior on GoDaddy. It has been up for a long time and I recall either recoding to this method or asking them to bump permissions. That is a second option... Third option(if possible) might be get a new host
PS
bidDocsGV is a gridview
Dim theBidPath As String = "./files/bid" & Request.QueryString("Bid").ToString() If Directory.Exists(Server.MapPath(theBidPath)) Then 'if it is there, write out the contents to the gridview Dim bidDocsInfo As New DirectoryInfo(Server.MapPath(theBidPath)) bidDocsGV.DataSource = bidDocsInfo.GetFiles() bidDocsGV.DataBind() Else
Lunadl,
I'll try this tonight and let you know. May have to move anyway though, as not sure what other disallowed code this project contains. Might as well switch to a full access provider while I can.
thanks.
medsoos
ASKER
I was able to work around this another way, by just hand-populating an array. But then as soon as that was fixed, came across another forbidden method. GoDaddy will not change their policies and I don't know how many more landmines exist in the hundreds of thousands of lines of code, so we're moving to a different host. Thanks for the help.