So i have a front end form that let users upload images from an URL...
Everything its ok when the image URL have the proper extension like this:
but when the image url doesn't have an extension like this :
My code doesn't work.
This is how i get the extension:
$filetype = wp_check_filetype($imageurl, null);
Now, if the file name of the image retrieved does have an extension, say jpg, then the output of the above call is
Array
(
[ext] => jpg
[type] => image/jpeg
)
However if the extension is not part of the file name then the call above returns the following array
Array
(
[ext] =>
[type] =>
)
How can i get the real file type for images that do not have an extension?