0

I have png photos uploaded to the ftp server. I want to see these photos directly on my local website. I don't want to download photos to the local. I want to have only ftp as the source itself.

I want to create a loop on the local website where my photos will alternate. The source of this loop will be the ftp server.

I don't know how to do it without downloading data. Is it even possible? Thanks

I connected to ftp with this command:

 <?php 
$host =  "xxx" ;
$user  =  'xxx' ;
$password  =  'xxx' ;
$ftpConn  =  ftp_connect ( $host ) or die("Nepodařilo se připojit k $host");;
$login  =  ftp_login ( $ftpConn , $user , $password ) ;

if(ftp_login ( $ftpConn , $user , $password )){
  echo "Přihlášení k FTP proběhlo v pořádku!";
}
else{
  echo "Přihlášení k FTP neproběhlo v pořádku!";
}

ftp_pasv($ftpConn, true);

// get file list of current directory
$file_list = ftp_nlist($ftpConn, ".");
var_dump($file_list);

// close connection
ftp_close($ftpConn);

?>

The connection was successful. The data were also located here.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

0 Answers0