TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Directory listing from remote location. (http://www.talkphp.com/absolute-beginners/4513-directory-listing-remote-location.html)

hjalmar 06-09-2009 09:09 PM

Directory listing from remote location.
 
So i'm looking for a way to retrieve a directory listing from a remote location.

Is my best way to grab the contents and regexp through what i need, or am I way off? alternative ways, curl? (my knowledge of curl is 0.000001% so i don't know :))

Thanks

Salathe 06-09-2009 09:13 PM

Is the directory listing publicly available? Would FTP be an option? A "directory listing" is pretty vague, where is the listing and in what form is it?

hjalmar 06-09-2009 09:17 PM

Quote:

Originally Posted by Salathe (Post 25120)
Is the directory listing publicly available? Would FTP be an option? A "directory listing" is pretty vague, where is the listing and in what form is it?

Yes it would have to be pubicly available. No, ftp would not be an option. Simple directory on another server.

Sorry could have been a bit clearer in my post.

:-$

*edit, please delete my error post below, :/

Salathe 06-09-2009 09:24 PM

Can you give an example directory listing? Will there only be one listing that you are wanting to grab, or many? Sorry for all of the questions and what might seem unimportant details, but they will affect what methods you can use to do the work.

Village Idiot 06-09-2009 09:32 PM

Quote:

Originally Posted by hjalmar (Post 25119)
So i'm looking for a way to retrieve a directory listing from a remote location.

Is my best way to grab the contents and regexp through what i need, or am I way off? alternative ways, curl? (my knowledge of curl is 0.000001% so i don't know :))

Thanks

So what you are looking to do is grab the directory listing from a server which you have no affiliation with. So if you were to go to www.xyz.com you could simply list all the files in it. If that is what you are trying to do, it is impossible unless the server you are getting it from specifically outputs it.

hjalmar 06-09-2009 09:33 PM

Quote:

Originally Posted by Salathe (Post 25123)
Can you give an example directory listing? Will there only be one listing that you are wanting to grab, or many? Sorry for all of the questions and what might seem unimportant details, but they will affect what methods you can use to do the work.

Just one, well accessing a directory with any browser will give you a html output with what files it contains. no? :)

So as simple as it sounds i'm only looking to extract filenames of whats contained in a directory located on another server. Running the script on the remote server is also out of the question.

I understand all the question. hopefully you are satisfied now :)

Village Idiot 06-09-2009 09:35 PM

Quote:

Originally Posted by hjalmar (Post 25125)
Just one, well accessing a directory with any browser will give you a html output with what files it contains. no? :)

No. The server upon getting a directory request will output an HTML file with the contents of the folder in it should no default page exist. That is if the server is configured to give directory listings. We don't allow directory browsing at my work for security reasons.

hjalmar 06-09-2009 09:47 PM

Quote:

Originally Posted by Village Idiot (Post 25126)
No. The server upon getting a directory request will output an HTML file with the contents of the folder in it should no default page exist. That is if the server is configured to give directory listings. We don't allow directory browsing at my work for security reasons.

I totally understand that, the point here isn't to go around stealing files from all over. So the server will have to generate a html output by default, the user will be aware of that.

So i'll go back to my initial post, best way to go about it?

Thanks

Salathe 06-09-2009 09:48 PM

The directory listing itself will vary depending on the software and configuration used for that particular site (or individual directory!). If you are only wanting this done for one site/directory then we need to know that URL; otherwise we can only give you generic advice about using the DOM extension to parse a HTML document.

hjalmar 06-09-2009 09:55 PM

Quote:

Originally Posted by Salathe (Post 25128)
The directory listing itself will vary depending on the software and configuration used for that particular site (or individual directory!). If you are only wanting this done for one site/directory then we need to know that URL; otherwise we can only give you generic advice about using the DOM extension to parse a HTML document.

Only advice i need. ^^

Thanks guys


All times are GMT. The time now is 05:53 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0