File PHP Class
This class is designed to perform very simple actions on files on or uploaded to your server.
Contents |
Table of contents
- Function list
- Variable list
- Creating a new File Class object
- Creating a new file
- Deleting a file
- Uploading a file
- Renaming a file
- Getting a file's contents
- Getting a directory's contents
- Checking if a file is a proper type
- Getting a file's type
- Including the Magic MIME File
Sample Code
$file = new fileClass();
if(!$file->isMime('/path/to/file')) {
$file->deleteFile('/path/to/file');
}
The above example will delete a file if it is not of an acceptable file type.
Features
- Read contents of a file as a string
- Determine the magic MIME file type of any file
- Check a file against an array of acceptable file types
- Create arrays of all files in a directory recursively
- Create, rename or delete files
- Move uploaded files
- Current Version
The current version of this software is 2.0.
Requirements
PHP 4.3.0+
MIME functions are better used with the Fileinfo extension but will function without them.