function upload_file ($file_object, $file_name, $path) {
//$file_object 本地文件名,不包括路径
//$file_name  上传后的文件名
//$path  上传到的目录
if($file_object != "") {
         $ftp_user_name='XXXXX';
        $ftp_user_pass='xxxxxx';
        $ftp_server='xxxxxxxxxxxxxxxx';
    $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
        $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);                if ((!$conn_id) || (!$login_result)) {
               echo "FTP connection has failed!";
               exit;
               }        $upload = ftp_put($conn_id,$path.$file_name, $file_object, FTP_BINARY);
       echo $path.$file_name;
       echo  $file_object;
    if (!$upload) {
        echo "FTP upload has failed!";
        return false;
    } else {
        echo "Uploaded  $file_object to $ftp_server as $path.$file_name";
    }
    ftp_close($conn_id);}
   return true;
   
}为什么每次运行都显示出"FTP upload has failed!"?我试过把$file object 改为绝对路径,也是不行。
请各位高手指教!