ftp_get - FTP 서버에서 파일을 다운로드합니다.

· 2017-02-14 (화) 23:08:29 · 4430

ftp_get - FTP 서버에서 파일을 다운로드합니다.

 

설명 ¶

 

부울 ftp_get ( 리소스 $ftp_stream , 문자열 $local_file , 문자열 $remote_file , int $mode [, int $resumepos= 0 ])

ftp_get () 은 FTP 서버에서 원격 파일을 가져 와서 로컬 파일에 저장합니다.

 

매개 변수 ¶

 

ftp_stream

FTP 연결의 링크 식별자입니다.

 

local_file

로컬 파일 경로 (파일이 이미 있으면 덮어 씁니다).

 

remote_file

원격 파일 경로.

 

mode

전송 모드. FTP_ASCII또는 중 하나 여야합니다 FTP_BINARY.

 

resumepos

원격 파일에서 다운로드를 시작할 위치입니다.

 

반환 값 ¶

 

반환 값 TRUE성공 또는 FALSE실패.

 

예 ¶

 

Example # 1 ftp_get () 예제

 

<?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_file

if (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 connection

ftp_close($conn_id);

 

?>

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
PHP 17-02-24 조회 3,640
PHP 17-02-24 조회 3,107
jQuery 17-02-23 조회 2,603
jQuery 17-02-23 조회 2,881
jQuery 17-02-23 조회 2,622
jQuery 17-02-22 조회 2,433
PHP 17-02-21 조회 2,678
PHP 17-02-21 조회 2,624
PHP 17-02-21 조회 4,417
PHP 17-02-20 조회 3,629
PHP 17-02-20 조회 3,016
PHP 17-02-20 조회 3,022
PHP 17-02-19 조회 2,840
PHP 17-02-19 조회 2,677
PHP 17-02-19 조회 2,822
PHP 17-02-17 조회 2,557
PHP 17-02-17 조회 2,985
PHP 17-02-17 조회 2,623
jQuery 17-02-16 조회 3,371
jQuery 17-02-16 조회 3,420
jQuery 17-02-16 조회 2,428
jQuery 17-02-15 조회 3,054
jQuery 17-02-15 조회 3,342
jQuery 17-02-15 조회 3,683
PHP 17-02-14 조회 2,881
PHP 17-02-14 조회 4,431
PHP 17-02-14 조회 2,669
PHP 17-02-13 조회 3,185
PHP 17-02-13 조회 2,593
PHP 17-02-13 조회 2,933