ftp_put - FTP 서버에 파일을 업로드합니다.

· 2017-02-21 (화) 23:14:10 · 4418

ftp_put - FTP 서버에 파일을 업로드합니다.

 

설명 ¶

 

bool ftp_put ( resource $ftp_stream , string $remote_file , string $local_file , int $mode [, int $startpos= 0 ])

ftp_put () 은 로컬 파일을 FTP 서버에 저장합니다.

 

매개 변수 ¶

 

ftp_stream

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

 

remote_file

원격 파일 경로입니다.

 

local_file

로컬 파일 경로.

 

mode

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

 

startpos

업로드를 시작할 원격 파일의 위치입니다.

 

반환 값 ¶

 

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

 

예 ¶

 

Example # 1 ftp_put () 예제

 

<?php

$file = 'somefile.txt';

$remote_file = 'readme.txt';

 

// 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);

 

// upload a file

if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {

 echo "successfully uploaded $file\n";

} else {

 echo "There was a problem while uploading $file\n";

}

 

// close the connection

ftp_close($conn_id);

?>

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

개발자팁

5,403건

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

+
분류 제목 글쓴이 날짜 조회
PHP 17-02-24 조회 3,646
PHP 17-02-24 조회 3,113
jQuery 17-02-23 조회 2,605
jQuery 17-02-23 조회 2,886
jQuery 17-02-23 조회 2,625
jQuery 17-02-22 조회 2,440
PHP 17-02-21 조회 2,684
PHP 17-02-21 조회 2,625
PHP 17-02-21 조회 4,419
PHP 17-02-20 조회 3,631
PHP 17-02-20 조회 3,019
PHP 17-02-20 조회 3,025
PHP 17-02-19 조회 2,841
PHP 17-02-19 조회 2,680
PHP 17-02-19 조회 2,825
PHP 17-02-17 조회 2,560
PHP 17-02-17 조회 2,987
PHP 17-02-17 조회 2,626
jQuery 17-02-16 조회 3,374
jQuery 17-02-16 조회 3,423
jQuery 17-02-16 조회 2,431
jQuery 17-02-15 조회 3,063
jQuery 17-02-15 조회 3,352
jQuery 17-02-15 조회 3,689
PHP 17-02-14 조회 2,883
PHP 17-02-14 조회 4,433
PHP 17-02-14 조회 2,673
PHP 17-02-13 조회 3,189
PHP 17-02-13 조회 2,601
PHP 17-02-13 조회 2,938