Page 1 of 1
WHM that works with an FTP server
Posted: Tue Oct 11, 2005 8:04 pm
by Trenchant
I created a online File Manager but I have noticed a very important flaw. When a user uploads a file via FTP the File Manager is not updated. All files in the file manger are recorded in a database(just file names and locations).
How can I fix this? Is there a way to scan for all files/folders in a specific folder?
I'm currently using PHP 4
Posted: Tue Oct 11, 2005 8:16 pm
by Skara
Posted: Tue Oct 11, 2005 8:33 pm
by Trenchant
how do I find folders with that? I can find files okay now but how do I find folders?
Also, how would I use glob to find the files in a different folder. Something like this?
Posted: Tue Oct 11, 2005 9:08 pm
by Skara
hmm.. If unix server with shell access, you could use ls, but other than that I don't know. I think glob accepts wildcards, though. Unless I'm thinking about a time I used grep in an ls shell command.

Posted: Tue Oct 11, 2005 9:14 pm
by Trenchant
The script has to work with both Windows and Unix. In the PHP manual is shows examples with glob("*.txt"); and glob("*.*"); but I'm not sure if you can put a dirrectory infront of that. thats all.
I just thought of a way to find folders and files. Although there might be a possible exploit in it. I would just have to find the files without .'s in them. Then check if the name is actually a dirrectory.
Posted: Tue Oct 11, 2005 9:24 pm
by feyd
glob can have a directory in front of the pattern...
Posted: Tue Oct 11, 2005 9:30 pm
by Trenchant
feyd wrote:glob can have a directory in front of the pattern...
What about when working with folders and files at the same time? Is there a way for glob to tell you if the result was a file or folder?
Posted: Tue Oct 11, 2005 9:41 pm
by feyd
Posted: Tue Oct 11, 2005 10:04 pm
by Trenchant
thanks.