Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

filename_exists

This functions checks of the file $file exists inside the folder $folder, if not it will create a unique name for the file to make sure it can be uploaded without replacing other files.

filename_exists

Quote

filename_exists ( string $dir , string $file )


Parameters
dir

The directory to check for the image, remember a / at the end of the directory path.

file

The file inside the directory you want to check exists.

Example
Code
<?php
/* Content in DOWNLOADS dir
 file.zip
 file_1.zip
 file_2.zip */
 
require_once INCLUDES."infusions_include.php";
 
$dir = DOWLNOADS;
$file = "file.zip";
 
echo filename_exists($dir, $file);
?>


Changelog
7.01.00 - Function added to PHPFusion