gedisz6 Posted November 29, 2010 Share Posted November 29, 2010 Hello, i want to check whether image exist or not, but i can't get any data about it. I have tried everything: getimagesize, file_exist, filesize, etc. <? $info = @getimagesize('http://jargames.eu/ic.php?lf=files/All phone/240x320/007-quantum_of_solace_240x320.jar'); if(isset($info['mime'])){echo 'Image exist';} else{echo 'Image doesnt exist';} ?> Ty, for your help. Link to comment https://forums.phpfreaks.com/topic/220139-check-whether-image-exist-or-not/ Share on other sites More sharing options...
Rifts Posted November 29, 2010 Share Posted November 29, 2010 if (file_exists("../images/photos/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; Link to comment https://forums.phpfreaks.com/topic/220139-check-whether-image-exist-or-not/#findComment-1140987 Share on other sites More sharing options...
ManiacDan Posted November 29, 2010 Share Posted November 29, 2010 He's looking for a REMOTE file's existence, I think. -Dan Link to comment https://forums.phpfreaks.com/topic/220139-check-whether-image-exist-or-not/#findComment-1140997 Share on other sites More sharing options...
gedisz6 Posted November 29, 2010 Author Share Posted November 29, 2010 Yes ManiacDan, you are right. I have 2 links: First link shows image - - http://jargames.eu/ic.php?lf=files/All%20phone/240x320/007-quantum_of_solace_240x320.jar Second link doesn't show image - - http://jargames.eu/ic.php?lf=files/All%20phone/240x320/20_q_mind_reader_240x320.jar So, i need somehow to check using php shows these links images or not. Link to comment https://forums.phpfreaks.com/topic/220139-check-whether-image-exist-or-not/#findComment-1140998 Share on other sites More sharing options...
ManiacDan Posted November 29, 2010 Share Posted November 29, 2010 Both of those files are accessible, but one of them isn't a valid image. You will have to copy them to the local filesystem and perform your operations on them there. This is a bad idea, however, since in my tests it took nearly 4 seconds to even OPEN these files. This webserver is too slow to be relied upon for your own site's functionality. -Dan Link to comment https://forums.phpfreaks.com/topic/220139-check-whether-image-exist-or-not/#findComment-1141007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.