PHP头条
热点:

通过php进行ftp文件下传时文件大小为0


通过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
------解决方案--------------------
$put_file 在哪里赋值的?
------解决方案--------------------
php的文件上传不是用$_POST处理的吧~我理解没错的话你是要先HTTP再FTP传~要弄清楚FTP是在服务器端进行的

www.phpzy.comtrue/phprm/16889.htmlTechArticle通过php进行ftp文件下传时文件大小为0 通过php进行ftp文件上传时文件大小为0 $user=$_COOKIE['user']; $passwd=$_COOKIE['passwd']; $current_dir='/home/web/text'; $conn_id=ftp_connect("localhost",21); $dir=$_REQUEST['dir...

相关文章

PHP之友评论

今天推荐