jasper182 Posted November 3, 2006 Share Posted November 3, 2006 Hi, I'm looking at doing some ftp stuff with php, and I was wondering if there is a good way to list the available files on a ftp server and allow the user to select one to open using php. I've looked around, but have been unable to find much on this topic. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/26018-php-and-ftp-help/ Share on other sites More sharing options...
Fallen_angel Posted November 3, 2006 Share Posted November 3, 2006 well the list could probably be done with ftp_nlist something like [code]<?php// set up basic connection$conn_id = ftp_connect($ftp_server);// login with username and password$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);// get contents of the current directory$contents = ftp_nlist($conn_id, ".");// output $contentsvar_dump($contents);?> [/code]however where to go from there I wouldn't be able to tell you without sitting there and tryign to do it for myself :) this link may help you though http://au3.php.net/ftp it has a list of all the php ftp commands and describes in detail the usage of each sorry if this wasn't much help but after you solved my issue for me I had to at least attempt to help :) Link to comment https://forums.phpfreaks.com/topic/26018-php-and-ftp-help/#findComment-118944 Share on other sites More sharing options...
jasper182 Posted November 3, 2006 Author Share Posted November 3, 2006 I haven't seen the ftp_nlist command, but it does show some promise. Thanks a lot, I'm glad we could help each other out on these. ;) Link to comment https://forums.phpfreaks.com/topic/26018-php-and-ftp-help/#findComment-118945 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.