File PHP Class
This class is designed to perform very simple actions on files on or uploaded to your server.
Download
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.
Current Version
The current version of this software is 2.0.
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
Requirements
- PHP 4.3.0+
- MIME functions are better used with the Fileinfo extension but will function without them.
Documentation
- 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
Home > Products > PHP classes > File PHP Class