PHP file uploading but can't find in directory : <p>I've checked several methods on stackoverflow but none is able to solve this.
I've made an html form to input <strong>file</strong> type through <strong>SELF_PHP</strong> form.
<em>Seems like PHP is uploading the file correctly but the directory to which it's being uploaded is empty</em> . Here's the code:
<strong>HTML</strong></p>

<pre><code>&lt;form method="post" id="fileUpForm" action="&lt;?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?&gt;" enctype="multipart/form-data" &gt;
    Select image to upload: 
    &lt;input type="file" name="fileToUpload" id="fileToUpload"&gt;
    &lt;input type="submit" value="Upload" name="submit"&gt;
&lt;/form&gt;
</code></pre>

<p><strong>PHP</strong></p>

<pre><code>&lt;?php 
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
    $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
    if($check !== false) {
        echo "File is an image - " . $check["mime"] . ".";
        $uploadOk = 1;
    } else {
        echo "File is not an image.";
        $uploadOk = 0;
    }
}
 ?&gt; 
</code></pre>

<p>Additional Info: .php file directory - <code>/var/www/html/FileUp.php</code><br>
uploads directory(to store files) - <code>/var/www/html/uploads/</code>
Code used(modified) from : '*schools.com'</p>
