通过php进行ftp文件上传时文件大小为0
$user=$_COOKIE['user'];
$passwd=$_COOKIE['passwd'];
$current_dir='/home/web/text';
$conn_id=ftp_connect("localhost",21);
$dir=$_REQUEST['dir'];
if(@ftp_login($conn_id,$user,$passwd))
{
if(ftp_put($conn_id,"$put_file","$dir",FTP_BINARY))
{
echo 123;
}
else
{
echo 234;
}
}
为什么这样写后,上传后有文件显示,但是文件的大小为0