php ftp_delete 与ftp_size教程
本文章来讲一下php ftp_delete删除文件 与ftp_size获取文件的大小,下面我们分别来看看二个函数的实例吧。
本文章来讲一下php ftp_delete删除文件 与ftp_size获取文件的大小,下面我们分别来看看二个函数的实例吧。
$file = 'public_html/old.txt';
// 连接FTP服务器
$conn_id = ftp_connect($ftp_server);
// 验证用户名和密码
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// 删除指定文件
if (ftp_delete($conn_id, $file)) {
echo "$file 文件删除成功 n";
} else {
echo "删除 $file 文件失败n";
}
// 关闭FTP连接www.111cn.cn
ftp_close($conn_id);
?>
$file = 'somefile.txt';
// 连接FTP服务器
$conn_id = ftp_connect($ftp_server);
//验证用户名和密码
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
//获取指定文件的大小www.111cn.cn
$res = ftp_size($conn_id, $file);
if ($res != -1) {
echo " $file 文件大小为 $res字节";
} else {
echo "获取远程文件大小失败";
}
//关闭FTP连接
ftp_close($conn_id);
?>
转载的朋友请注明来自www.111cn.cn

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools