My $_FILES['file']['name'] is producing gibberish <p>I am uploading files with the following code using Bootstrap as my front-end framework.</p> <pre><code>&lt;form method="POST" enctype="multipart/form-data" action= "php/up-load.php" role="form" &lt;div class="form-group"&gt; &lt;label for="file" class="col-sm-5 control-label"&gt; Select file(Compressed format) &lt;/label&gt; &lt;div&gt; &lt;input type="hidden" name="MAX_FILE_SIZE" value="1000000000"/&gt; &lt;input type="file" id="file" name="file" accept=".zip, .rar"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;button type="submit" class="btn btn-primary" name="upload" id="upload"&gt;Send&lt;/button&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>My php code is; </p> <pre><code>@ $original=$_FILES['file']['name']; @ $kiss=pathinfo($original, PATHINFO_EXTENSION); $allowed_extensions = array(".zip","rar","bzip2","iso","gz","rz","7z","tar","tgz","bz2","tbz2","lzma","tlz"); $result = in_array ("$kiss", $allowed_extensions); if (!$result) { // Wrong file type } else { //proceed.. } </code></pre> <p>My problem is that the</p> <pre><code>$_FILES['file']['name']; </code></pre> <p>is returning gibberish such as <code>php7vy8X9</code> and <code>phpY8wQVR</code> . Have tried everything. What could be the problem?</p>