We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5340
    • 1,624 Posts
    Hi,

    I cannot seem to get the $_FILES values using the eform events.

    I’m using
    &eFormOnValidate=`uploadFile`



    +

    function uploadFile( &$fields, &$vMsg, &$rMsg ){
        $userfile = $_FILES['userfile']['name'];
        $file_size = $_FILES['userfile']['size'];
        $file_temp = $_FILES['userfile']['tmp_name'];
        $file_err = $_FILES['userfile']['error'];
        $path = '/';
        
        $fp = fopen('data.txt', 'a+');
        fwrite($fp, '->' . $_FILES['userfile']['name']);
        fclose($fp);
        
        
        //move_uploaded_file($file_temp, $path);
        
        return true;
    }


    $_FILES seems to be an empty array.

    Is there another way I can find out the path of the temporary uploaded file so I can move it?

    Thx
      • 26401
      • 247 Posts
      had the same issue
      try adding:
      enctype="multipart/form-data"
      to the form tag
        • 5340
        • 1,624 Posts
        Thx,

        That was the problem