Upload helper class for working with the global $_FILES array and Validation library.
This is the code documentation for the SproutCMS project
Search documentation |
class UploadThis class is deprecated This is old Kohana cruft Upload helper class for working with the global $_FILES array and Validation library.
Extending this class<?php /** * New class description goes here * * @author Your Name, 2024-11-25 **/ class NewClassName extends Upload { /** * Tests if input data is valid file type, even if no upload is present. **/ public function valid (array $file) { // Method code goes here } /** * Tests if input data has valid upload data. **/ public function required (array $file) { // Method code goes here } /** * Validation rule to test if an uploaded file is allowed by extension. **/ public function type (array $file, array $allowed_types) { // Method code goes here } /** * Validation rule to test if an uploaded file is allowed by file size. * File sizes are defined as: SB, where S is the size (1, 15, 300, etc) and * B is the byte modifier: (B)ytes, (K)ilobytes, (M)egabytes, (G)igabytes. * Eg: to limit the size to 1MB or less, you would use "1M". **/ public function size (array $file, array $size) { // Method code goes here } /** * Save an uploaded file to a new location. **/ public function save (mixed $file, string $filename, string $directory, integer $chmod) { // Method code goes here } } ?> |
Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Monday, 3rd April, 2023 at 02:59 pm |