UYou can connect to the server through ftp from codeusing the FTP protocol, and download itthe file to your server or local and you can show it .
function example_download_image() {
$local_file = 'tmp/download.jpg';
$server_file = 'tmp_server/download.jpg';
$ftp_server = "ftp.server.com";
$conn_id = ftp_connect($ftp_server);
$ftp_user_name = "user_name";
$ftp_user_pass = "password";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
ftp_pasv($conn_id, true);
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
// }
Show the file.
}
else {
drupal_set_message("There was a problem\n");
}
ftp_close($conn_id);
}