Jump to content

Check whether image exist or not.


gedisz6

Recommended Posts

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

Yes ManiacDan, you are right. I have 2 links:

 

First link shows image - 007-quantum_of_solace_240x320.jar - http://jargames.eu/ic.php?lf=files/All%20phone/240x320/007-quantum_of_solace_240x320.jar

Second link doesn't show image - 20_q_mind_reader_240x320.jar - 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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.