$_FILES empty and does not contain any data
<p>before I describe my problem, I really did search on the internet and here in this website to find the solution. I found a question that is really similar to my problem, but the given answer is not even close, so I'm here to write my problem.  </p>

<p>the problem is:<br>
I've <code>form</code> that has some input fields plus <code>input type='file'</code> for uploading images. this form inside <code>jquery-ui dialog</code>, when I submit the <code>form</code>, all fields response as it should be, except <code>input type='file'</code>for images it never carry any data of the image.<br>
here is the code that explain my problem:  </p>

<p><strong>update_form.php:</strong></p>

<pre><code>&lt;form action="" class="fixed-dialog" method="post" id="customForm" enctype="multipart/form-data"&gt;
    &lt;input type="file" class="form-group input-field" accept="image/jpg,image/png,image/jpeg,image/gif" id="image" name="image" /&gt;
&lt;/form&gt;
</code></pre>

<p>When the user click <code>Send</code> button, this code will fire <strong>(JQuery)</strong>:  </p>

<pre><code>$("#send").click(function(){
    var all = $("#customForm").serialize();
    //the following condition is to check if all input fields were filled.
    $.ajax({
        type: "POST",
        url: "includes/update_user_info.php",
        data: all,
        success: function(data){
            if(data == 1){
                alert("You have update data successfuly");
                window.location = "index.php";
            }else{
                 alert("there is an error");
            }
        }
    });
});
</code></pre>

<p>here is <strong>update_user_info.php:</strong> to move the image from tmp file to other file  </p>

<pre><code>$user_image           = &amp;$_FILES['image']['name'];
$user_image_type      = &amp;$_FILES['image']['type'];
$user_temp_image      = &amp;$_FILES['image']['tmp_name'];
if(isset($_FILES['image'])){
    $_SESSION['errors'] = "it's set.\n";

    //the next statement is empty, it should carry some data.
    $_SESSION['errors'] .= $_FILES['image']['tmp_name'];
}else{
    $_SESSION['errors'] = "NOT SET YET!!!";
}

$target = "./images/users_img/".$user_image;
$source = $_FILES['image']['tmp_name'];
//        if($_FILES['image']['error'] == 0){
            move_uploaded_file($_FILES['image']['tmp_name'],$target);
            $_SESSION['errors'] .= "Target is: ".$_FILES['image']['tmp_name'];
            if(is_uploaded_file($_FILES['image']['tmp_name'])){
                $_SESSION['errors'] .= "Target is: it Worked";
                echo 1;
            }else{
                $_SESSION['errors'] .= "Target is: NOT WORKING";
                echo 1;
            }
//        }else{
//            $_SESSION['errors'] .= "Something went Wrong!!";
//            echo 1;
//        }
</code></pre>

<p>when I tried to echo <code>$_FILES['image']['tmp_name']</code>, or<code>['name']</code>or <code>['error']</code>, it always gives me an error:<br>
<strong>Undefined index: name/tmp_name/or error</strong>,<br>
<strong><code>isset($_FILES['image'])</code> = TRUE.</strong>, <strong>BUT:</strong><br>
<strong><code>$_FILES['image']['name']</code> is empty.</strong>  </p>

<p>any help will be appreciated.<br>
thank you.</p>