Guest User

Untitled

a guest
Oct 17th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. // connect and login to FTP server
  2. $ftp_server = "IP";
  3. $ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
  4. $login = ftp_login($ftp_conn, "name", "password");
  5.  
  6. // list all files in upload directory and with "a" download file
  7. $target_dir = "uploads/";
  8. $files = ftp_nlist($ftp_conn, $target_dir);
  9. foreach($files as $file) {
  10. echo "<a href='$file' download>$file</a>";
  11. echo "<br>";
  12. }
Add Comment
Please, Sign In to add comment