 <p>The <code>enctype</code> should be on the <code>&lt;form&gt;</code> element</p> <pre><code>&lt;form method="POST" enctype="multipart/form-data"&gt; &lt;input type="file" name="uploaded" style="margin-bottom: 10px"&gt; &lt;/form&gt; </code></pre> <p>PHP:</p> <pre><code>&lt;?php echo $_FILES['uploaded']['type'] ?&gt; </code></pre>