채택완료

ftp포트만 열려있는데 다른 서버에서

2016-11-03 (목) 21:33:06 3,746

ftp포트만 열려있는데  

A서버에서 B서버를 FTP를 이용해 접속해

자료를 가져올수 있나요..?

PHP를 통해서요..

찾아보니까 ftp_connect 이런게 있든데  맞는지

|

답변 1개

채택된 답변
+20 포인트

http://php.net/manual/en/function.ftp-get.php 

여기 참조해보세요.

Copy
<?php// define some variables$local_file = 'local.zip';$server_file = 'server.zip';// 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);// try to download $server_file and save to $local_fileif (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {    echo "Successfully written to $local_file\n";} else {    echo "There was a problem\n";}// close the connectionftp_close($conn_id);?>

답변을 작성하려면 로그인이 필요합니다.