Questions tagged [file-exists]

A "FileExists" method provides a mechanism to determine if a specified path/file exists.

Overview

FileExist methods, which are available in most languages, typically have a path/filename parameter and return a Boolean value, indicating whether the file exists.

Implementations

The following links provide reference to the method descriptions for various languages:

606 questions
3
votes
2 answers

fileExistsAtPath and checkResourceIsReachableAndReturnError both didn't work

fileExistsAtPath and checkResourceIsReachableAndReturnError both returns NO Even the file exists at server URL I have a file in (local)server in http://10.0.0.15/images/hibrise.png NSURL *url=[NSURL…
AlgoCoder
  • 1,706
  • 5
  • 19
  • 40
3
votes
2 answers

Check whether the path exists on server or not in Java

I'm creating a Java program in which I upload a file to a server on a particular path. I am using jSch for sftp. So, before uploading the file, I want to check if the given directory exists on server or not. if(path exists) //upload file to the…
earthmover
  • 4,395
  • 10
  • 43
  • 74
3
votes
3 answers

VBScript to move file with wildcard, if it exists

I am attempting to create a script that checks for the existence of archived eventlog files and, if any files exist, moves them to another folder. Running this script does nothing and gives no errors. I believe the wildcard in the If statement is…
user3157550
  • 31
  • 1
  • 1
  • 2
3
votes
3 answers

CPU load with file_exists in php

i own a site with a high load cpu httpd request per minute. I've noticed i use "file_exists" on each httpd request. Is that function to much heavy?
Andres SK
  • 10,779
  • 25
  • 90
  • 152
3
votes
2 answers

PROGRESS - Validating a user-input file output path

I've written some PROGRESS code that outputs some data to a user defined file. The data itself isn't important, the output process works fine. It's basically DEFINE VARIABLE filePath. UPDATE filePath /*User types in something like…
user2961924
  • 31
  • 1
  • 2
3
votes
2 answers

php's file_exists is returning false for file name having foreign language characters

$file_name = "x:/htdocs/host/sales_documents/testvilkår, webhotell og domenenavn_2ccda.pdf"; if(!file_exists($file_name)) { echo "

404 Error

"; exit; } File name is a valid file and also it really exist, but still file_exists is…
Vikramraj
  • 188
  • 4
  • 18
3
votes
2 answers

php file exists returns nothing always - CodeIgniter

I'm wanting to display images. The user can add up to 7 images, but they can also add less than 7 if needed. I searched around and saw that file_exists() is the function I'm after, but I've tried a couple of ways and it always gives me no…
a7omiton
  • 1,597
  • 4
  • 34
  • 61
3
votes
1 answer

Checking if a file exists using JSTL in a JSP page

Is possible to check in JSTL if a file exists (exactly an image): Simply issue of viewing profile image. If is in the folder with images profile image show the profile image, if not show default image. This is a pseudo code: if file img/1.jpg…
user1097772
  • 3,499
  • 15
  • 59
  • 95
3
votes
2 answers

Check if folder exists in a webserver using python and http functions

Is there a way to check if a folder exists on a web server with Python? (something like "os.path.isdir" but reading HTTP responses as "HTTP/404" if not found)
user962284
  • 670
  • 1
  • 12
  • 29
3
votes
1 answer

How can I efficiently get a list of matching Amazon S3 files?

Assume 200,000 images in a flat Amazon S3 bucket. The bucket looks something like this: 000000-1.jpg 000000-2.jpg 000000-3.jpg 000000-4.jpg 000001-1.jpg 000001-2.jpg 000002-1.jpg ... ZZZZZZ-9.jpg ZZZZZZ-10.jpg (a 6 digit hash followed by a count,…
Ryan
  • 14,682
  • 32
  • 106
  • 179
2
votes
2 answers

PHP: check if image exists (methods)

I have more than 5000 image links and I need to find a way to check if they exist. I used getimagesize(), but it took too long. The speed is critical for me. I wrote a little function, but it's not working, I don't know why. function…
Reteras Remus
  • 923
  • 5
  • 19
  • 34
2
votes
1 answer

how to check if file something(a number).php exists?

Say I have all these files in a folder: something(34324).php something(34).php something(3433454546).php something(65565).php something(9887).php something(4585).php // ect ect Now I need to somehow check if any something.php file exists (ignoring…
user849137
2
votes
4 answers

How can I check if a file exists on FTP server?

I am using apache FTPClient on android. I want to download a file from ftp server. But I want check if it exists on server before downloading. How can I check this? Thanks, my code: public static boolean getFile(String serverName, String userName, …
Bob
  • 22,810
  • 38
  • 143
  • 225
2
votes
2 answers

How can you check if a file is stored in Azure Blob

We have a flash app running on our web site (which is a Azure site). It needs to access images in blob storage. I had to create a crossdomain.xml file programatically so there won't be any issues with Flash getting cross domain restrictions. But…
AndyMan
  • 115
  • 1
  • 12
2
votes
2 answers

Check to see if any file exists within a folder (VBScript)

How can I check if there exists a file within a folder with any name? I also want to ignore sub-folders. Thanks. EDIT: Think I've got it but any contributions are also appreciated... If Folder.Files.Count > 0 Then 'Do something
bobble14988
  • 1,749
  • 5
  • 26
  • 38