función de PHP ftp_size ()
Definición y Uso
ftp_size () devuelve el tamaño del archivo en el servidor FTP.
Esta función devuelve los bytes del tamaño de archivo especificado, o -1 si ocurre un error.
gramática
ftp_size(ftp_connection,file)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
file | 必需。规定要检查的文件。 |
Notas y sugerencias
Nota: No todos los servidores FTP admiten esta función.
Ejemplos
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
echo ftp_size($conn,"test.txt");
ftp_close($conn);
?>
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
echo ftp_size($conn,"test.txt");
ftp_close($conn);
?>
El código anterior es la salida:
160
Completar PHP FTP Referencia