Welcome Guest, Not a member yet? Register   Sign In
How to check if file exists via URL
#1

[eluser]codex[/eluser]
When you try to get a file that doesn't exist you get the 'failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found'-error, but how do you prevent this? I'm using file_exists to check if a file is present, but it chokes on the 404.

For instance
Code:
http://img.youtube.com/vi/XgdmsJsOKJc/2.jpg
is valid, while
Code:
http://img.youtube.com/vi/jksfhjhfjfdjsfjdsjhjhfd/2.jpg
isn't.

How do you check the validity??


Messages In This Thread
How to check if file exists via URL - by El Forum - 10-30-2007, 09:45 PM
How to check if file exists via URL - by El Forum - 10-31-2007, 06:19 AM
How to check if file exists via URL - by El Forum - 10-31-2007, 07:59 AM
How to check if file exists via URL - by El Forum - 10-31-2007, 08:06 AM
How to check if file exists via URL - by El Forum - 10-31-2007, 08:11 AM
How to check if file exists via URL - by El Forum - 10-31-2007, 08:19 AM
How to check if file exists via URL - by El Forum - 10-31-2007, 02:01 PM
How to check if file exists via URL - by El Forum - 06-21-2010, 01:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB