ftp_put - FTP 서버에 파일을 업로드합니다. > 개발자팁

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!

개발자팁

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

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

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

본문

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

?>

추천
0

댓글 0개

전체 5,348
개발자팁 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT