i am developing a site that relies on the only contents of a folder to be uploaded images, is there a way to stop this file being added?
if not what is the best way i can make sure it is removed regularly?
thanks
[SOLVED]THUMBS.DB
Moderator: General Moderators
-
rubberjohn
- Forum Contributor
- Posts: 193
- Joined: Fri Feb 25, 2005 4:03 am
[SOLVED]THUMBS.DB
Last edited by rubberjohn on Thu May 19, 2005 5:05 am, edited 2 times in total.
instead of filtering out thumbs.db:
make sure all the files you are uploading are what you want, for example by extension, etc.
If you only filter out the thumbs.db files, then you are going to upload files that you don't want to by other names.
Code: Select all
if ( $file != "thumbs.db" ) uploadFile($file);If you only filter out the thumbs.db files, then you are going to upload files that you don't want to by other names.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
In that case you probably end up with an array
And then it's only a matter of finding the right http://www.php.net/array function to filter those out...
Code: Select all
$ignore = array('.', '..', 'thumbs.db');Code: Select all
$ignore = array('.', '..', 'thumbs.db');
$files = /* Function to read folder for all files */
$validFiles = array_diff( $ignore, $files );
uploadFiles( $validFiles );-
rubberjohn
- Forum Contributor
- Posts: 193
- Joined: Fri Feb 25, 2005 4:03 am
thanks
cheers thats been a big help