$contents = File::get('path/to/file');
File::put('path/to/file', 'file contents');
File::append('path/to/file', 'appended file content');
File::delete('path/to/file');
Input::upload('picture', 'path/to/pictures', 'filename.ext');
Note: You can easily validate file uploads using the Validator class.
File::extension('picture.png');
if (File::is('jpg', 'path/to/file.jpg'))
{
//
}
The is method does not simply check the file extension. The Fileinfo PHP extension will be used to read the content of the file and determine the actual MIME type.
Note: You may pass any of the extensions defined in the application/config/mimes.php file to the is method. Note: The Fileinfo PHP extension is required for this functionality. More information can be found on the PHP Fileinfo page.
echo File::mime('gif'); // outputs 'image/gif'
Note: This method simply returns the MIME type defined for the extension in the application/config/mimes.php file.
File::cpdir($directory, $destination);
File::rmdir($directory);