Getting a file type from URL
<p>I need To find out the file type from a url image located on my server without checking the extension, but I'm not sure how to do that without putting the image into an "input" like this:</p>

<pre><code> &lt;input type="file" id="upload_file" accept="image/*|audio/*|video/*"/&gt;
 &lt;input type="submit"  onclick="sumbit()"/&gt;

&lt;script type="text/javascript"&gt;
    function sumbit(){
        var file_Element = document.getElementById("upload_file")
        alert(file_Element.files[0].type);
        //alert: image/png
    } 
&lt;script&gt;
</code></pre>

<p>I understand that ".type" only work with a file object, so how do I turn the url image into an object like this image of google's logo: <a href="https://www.google.ca/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" rel="nofollow">https://www.google.ca/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png</a>.
Do I need to use a ajax/flilereader? if so, how?</p>