PHP’s file_exists() will not work for me?

file_exists() needs to use a file path on the hard drive, not a URL. So you should have something more like: $thumb_name = $_SERVER[‘DOCUMENT_ROOT’] . ‘images/userphoto/1/2/2/59874a886a0356abc1_thumb9.jpg’; if(file_exists($thumb_name)) { some_code } http://us2.php.net/file_exists

Check if file exists on remote server using its URL [duplicate]

import java.net.*; import java.io.*; public static boolean exists(String URLName){ try { HttpURLConnection.setFollowRedirects(false); // note : you may also need // HttpURLConnection.setInstanceFollowRedirects(false) HttpURLConnection con = (HttpURLConnection) new URL(URLName).openConnection(); con.setRequestMethod(“HEAD”); return (con.getResponseCode() == HttpURLConnection.HTTP_OK); } catch (Exception e) { e.printStackTrace(); return false; } } If the connection to a URL (made with HttpURLConnection) returns with HTTP status … Read more

How to check if a file exists from a url

You don’t need CURL for that… Too much overhead for just wanting to check if a file exists or not… Use PHP’s get_header. $headers=get_headers($url); Then check if $result[0] contains 200 OK (which means the file is there) A function to check if a URL works could be this: function UR_exists($url){ $headers=get_headers($url); return stripos($headers[0],”200 OK”)?true:false; } … Read more

Deleting a file in VBA

1.) Check here. Basically do this: Function FileExists(ByVal FileToTest As String) As Boolean FileExists = (Dir(FileToTest) <> “”) End Function I’ll leave it to you to figure out the various error handling needed but these are among the error handling things I’d be considering: Check for an empty string being passed. Check for a string … Read more

VBA check if file exists

something like this best to use a workbook variable to provide further control (if needed) of the opened workbook updated to test that file name was an actual workbook – which also makes the initial check redundant, other than to message the user than the Textbox is blank Dim strFile As String Dim WB As … Read more