EchoFool Posted January 7, 2010 Share Posted January 7, 2010 Is there a way in php to check an url points to an image file ? I'm tryin to get users to submit urls to images such as www.test.com/images/image.jpg But if some one puts a link to lets say a html file or a movie file or audio file - i need php to decline it. I currently use file_exists for checking if the image exists but i need to prevent other types of urls first. Link to comment https://forums.phpfreaks.com/topic/187520-url-pointing-to-image-fle-validation/ Share on other sites More sharing options...
void Posted January 7, 2010 Share Posted January 7, 2010 use getimagesize(); will do the work, if the server configuration will permit remote files. Link to comment https://forums.phpfreaks.com/topic/187520-url-pointing-to-image-fle-validation/#findComment-990096 Share on other sites More sharing options...
EchoFool Posted January 7, 2010 Author Share Posted January 7, 2010 But what if it doesn't? Is there any alternative Link to comment https://forums.phpfreaks.com/topic/187520-url-pointing-to-image-fle-validation/#findComment-990097 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.