It is not appending the variable

前端 未结 1 943
礼貌的吻别
礼貌的吻别 2021-01-29 13:42

I want to append the name of the file which has been uploaded using the $_POST method to post the $_FILES[\'fileImage\'][\'name\'] from the php script.

相关标签:
1条回答
  • 2021-01-29 14:18

    Because you're looking in $_POST for a variable which is in $_SESSION. Try changing it to:

    $output = array();
    if(isset($_SESSION['fileImage'])){
        $idx = count($_SESSION['fileImage']) -1 ;
        $output[] = isset($_SESSION['fileImage'][$idx]) ?
            $_SESSION['fileImage'][$idx]['name'] : "";
    }
    
    0 讨论(0)
提交回复
热议问题