When attempting to add items from local server I get the following error:
Quote:
The directory you entered is illegal. It must be a sub directory of one of the directories listed below
In my case I'm attempting to "find files" in C:\Pictures. This has been added as a "Legal Directory".
When I look through the debug output I see (along with a lot of other stuff) the following:
file_exists(c:\gallery2\modules\core/ItemAddFromBrowser.inc)
file_exists(c:\gallery2\modules\core/ItemAddFromWeb.inc)
file_exists(c:\gallery2\modules\remote/ItemAddGalleryRemote.inc)
file_exists(c:\gallery2\modules\uploadapplet/ItemAddUploadApplet.inc)
realpath(c:\pictures)
file_exists(c:\Pictures)
is_readable(c:\Pictures)
realpath(c:\Pictures)
realpath(\c
realpath(\c:\Pictures)
It looks to me like somewhere the path is being prepended with a backslash which causes it to fail.
Thanks,
-mg
Posts: 8601
ha, good catch. my guess is since the path doesn't start with a / or \ it thinks it's a relative path so it sticks a \ on the front.. need to check for drive letter case too.
Posts: 8601
I think the illegal dir error occurs because you didn't match case.. "c:" vs "C:" ? Hmm, do we need a fix for this?
But the realpath calls with leading \ come from a different bit of code, in ItemAddFromServer.inc.
mgrant, what do you get from this php code on your system?
<?php print dirname("C:\\Pictures") . "<br/>\n" . dirname("C:\\"); ?>
Posts: 100
mindless,
Posts: 8601
Cool, thanks. I updated the logic there, so I think it should recognize "C:\" as the "root" dir and not try to put "\" on the front. Update in a few hours and see how it looks. I didn't fix the case-sensitivity thing yet.
Posts: 100
mindless,
I just updated and I cannot duplicate the problem entirely. The leading backslash is still present but I can succesfully "Find Files" without an error and it returns a listing of the specified directory.
So, either I got your changes in my update and they did the trick or I was just doing something wrong earlier.
I can confirm that it IS case sensitive. If my legal directory is c:\pictures and I try to find files is C:\pictures it will fail. If, however, I have both listed as legal directories it will work (until I enter C:\Pictures or c:\PiCTuRes) ;-)
Posts: 100
mindless,
One other thing to think about...
Local content might not always be on drive C so the updated logic should take into acount ANY valid drive letter.
You know - life would be a lot easier if I'd just give up and switch to linux already.
Thanks,
-mg
Posts: 7994
Yeah but then we wouldn't be getting the benefit of all the time that you're spending helping improve G2 on IIS There are a lot of people out there who will appreciate you for your efforts!
Posts: 100
I've tried every variation I can think of and they're all handled properly. Case sensitivity doesn't appear to be a problem any more. I even tried:
C:\Denied\..\Allowed
And this worked. I've not yet tested with drive letters other than C: but I will shortly and I'll let you know if it doesn't work.
Thanks for the great work you're doing.
-mg
Posts: 8601
cool, thanks for testing.. yes, I did fix the case-sensitivity thing the other day. Unix platform is still case-sensitive, of course..