Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // connect and login to FTP server
- $ftp_server = "IP";
- $ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
- $login = ftp_login($ftp_conn, "name", "password");
- // list all files in upload directory and with "a" download file
- $target_dir = "uploads/";
- $files = ftp_nlist($ftp_conn, $target_dir);
- foreach($files as $file) {
- echo "<a href='$file' download>$file</a>";
- echo "<br>";
- }
Add Comment
Please, Sign In to add comment