컴

ftp_size - 주어진 파일의 크기를 반환합니다.

· 2017-02-25 (토) 02:07:07 · 2595

ftp_size - 주어진 파일의 크기를 반환합니다.

 

설명 ¶

 

int ftp_size ( resource $ftp_stream , string $remote_file )

ftp_size () 는 주어진 파일의 크기를 바이트 단위로 반환합니다.

 

참고 :

모든 서버가이 기능을 지원하는 것은 아닙니다.

매개 변수 ¶

 

ftp_stream

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

 

remote_file

원격 파일.

 

반환 값 ¶

 

성공하면 파일 크기를 반환하고 오류가 발생하면 -1을 반환합니다.

 

예 ¶

 

Example # 1 ftp_size () 예제

 

<?php

 

$file = 'somefile.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);

 

// get the size of $file

$res = ftp_size($conn_id, $file);

 

if ($res != -1) {

    echo "size of $file is $res bytes";

} else {

    echo "couldn't get the size";

}

 

// close the connection

ftp_close($conn_id);

 

?>

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

개발자팁

5,403건

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

+
분류 제목 글쓴이 날짜 조회
PHP 17-03-09 조회 2,786
PHP 17-03-09 조회 2,665
PHP 17-03-09 조회 2,871
jQuery 17-03-09 조회 2,311
jQuery 17-03-09 조회 2,188
jQuery 17-03-09 조회 2,137
PHP 17-03-08 조회 2,140
PHP 17-03-08 조회 2,318
PHP 17-03-08 조회 2,295
jQuery 17-03-08 조회 2,809
jQuery 17-03-08 조회 2,619
jQuery 17-03-08 조회 2,757
기타 17-03-08 조회 1.7만
기타 17-03-06 조회 2,598
PHP 17-03-01 조회 3,029
PHP 17-03-01 조회 3,548
PHP 17-03-01 조회 2,468
PHP 17-02-28 조회 2,146
PHP 17-02-28 조회 2,333
PHP 17-02-28 조회 2,540
PHP 17-02-27 조회 2,780
PHP 17-02-27 조회 2,640
PHP 17-02-27 조회 3,233
PHP 17-02-26 조회 2,580
PHP 17-02-26 조회 2,476
PHP 17-02-26 조회 2,865
PHP 17-02-25 조회 2,596
PHP 17-02-25 조회 2,641
PHP 17-02-25 조회 2,529
PHP 17-02-24 조회 2,992