View Full Version : Remote directory listing
Mhtml
02-23-2006, 10:38 AM
What permissions, if any, will I need access to, and what should I set them to in order to list all the files within a remote directory?
you are accessing it remotely with PHP ? how? otherwise it is difficult to answer
Mhtml
02-24-2006, 12:52 AM
Oh geez, how rude of me. I was thinking of either fopen of scandir.
ok.. just so there is even less confusion.. when you say a remote server, do you mean running a php script to access an actual remote server? or access directories that PHP itself resides on -- if that is the case then could files either need to be world readable (644) or simply be accessible by the user/group apache uses (e.g., nobody:nobody) which if you don't know can be determine by looking in your httpd.conf or running the following from a shell:
grep -i '^\(Group\|User\)' /etc/apache/httpd.conf
Mhtml
02-24-2006, 03:48 AM
I mean to say that it is a completely different server. I've written a php application that creates an ASX, XML file and it currently selects random files from local directories... However apparently the files are on another server (this wasn't explained to me when I was hired to create it) and so now I'm stuck with making it work with a remote server. I'm not even sure what the other server is even (could be IIS).
ouch.. well, how will fopen or scandir accomplish this then? Is it possible to FTP in and then cache that information?
Mhtml
02-24-2006, 04:54 AM
Actually I don't know, I was just hoping for a quick fix but I just read the actual documentation. I had thought about ftp, but I like to avoid that, always feels like a hack.
I think that I'm going to have to find a comprimise.
Actually I don't know, I was just hoping for a quick fix but I just read the actual documentation. I had thought about ftp, but I like to avoid that, always feels like a hack.
I think that I'm going to have to find a comprimise.
yeah. the easiest and probably most secure way(if the remote server is running sshd), is to use ssh keys so then you would just do something like this to get the remote information:
ssh -i path/to/id_dsa user@server.com 'ls -1'
there may be another more ideal solution though
Mhtml
02-24-2006, 05:46 AM
Well the other server is actually Apache/php so I'll just run fopen a php file which will complete the random file selection and output it for me. Easy fixed.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.