scliburn Posted October 31, 2006 Share Posted October 31, 2006 since the url wrappers is not available, does anyone have any solid suggestions. This seems to be escaping me.Any function that would return a true or false for some of boolean code would be awesome.the file will be a jpg 100% of the time. Quote Link to comment https://forums.phpfreaks.com/topic/25724-checking-if-a-file-exists-via-http-using-439/ Share on other sites More sharing options...
wildteen88 Posted October 31, 2006 Share Posted October 31, 2006 If the url wrappers are disabled then there is no other way of checking if a file exists on a remote server. Quote Link to comment https://forums.phpfreaks.com/topic/25724-checking-if-a-file-exists-via-http-using-439/#findComment-117443 Share on other sites More sharing options...
scliburn Posted October 31, 2006 Author Share Posted October 31, 2006 url wrappers is open, however file_exists (to my understanding) won't be able to use this until php5. did you have a suggestion? Quote Link to comment https://forums.phpfreaks.com/topic/25724-checking-if-a-file-exists-via-http-using-439/#findComment-117446 Share on other sites More sharing options...
wildteen88 Posted October 31, 2006 Share Posted October 31, 2006 So now url wrappers is open! You just said in your first post it is not available, which I've quoted below:[quote]since the [b]url wrappers [color=red]is not[/color] available[/b], does anyone have any solid suggestions.[/quote]Also file_exists is version independent as its available for PHP3, 4 and 5 Quote Link to comment https://forums.phpfreaks.com/topic/25724-checking-if-a-file-exists-via-http-using-439/#findComment-117458 Share on other sites More sharing options...
scliburn Posted October 31, 2006 Author Share Posted October 31, 2006 yes, I am aware of the quote. it's posted for all to see. Thank you.Yes you are correct, i stated initially [quote]url wrappers is not available[/quote]. My mistake. url wrappers is [b]open[/b] but not available for this [quote]version independent[/quote] function file_exists(). [quote]Tip: As of PHP 5.0.0 this function can also be used with some URL wrappers. Refer to Appendix M for a listing of which wrappers support stat() family of functionality.[/quote]However the post is titled:[quote]checking if a [b]file exists[/b] via http using 4.3.9 [/quote]wildteen88 can you think of an alternative? thank you for response. Quote Link to comment https://forums.phpfreaks.com/topic/25724-checking-if-a-file-exists-via-http-using-439/#findComment-117463 Share on other sites More sharing options...
scliburn Posted October 31, 2006 Author Share Posted October 31, 2006 decided to go with getimagesize and if returns false, image doesn't exist. Quote Link to comment https://forums.phpfreaks.com/topic/25724-checking-if-a-file-exists-via-http-using-439/#findComment-117518 Share on other sites More sharing options...
mainewoods Posted November 1, 2006 Share Posted November 1, 2006 maybe you could just try the file_get_contents() function and if it returns false assume the file is absent. Or for sure you could use the curl library. Quote Link to comment https://forums.phpfreaks.com/topic/25724-checking-if-a-file-exists-via-http-using-439/#findComment-117626 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.