SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Upload

This class is deprecated


This is old Kohana cruft

Upload helper class for working with the global $_FILES array and Validation library.

Functions

NameVisibilityDescription
requiredpublic (static)Tests if input data has valid upload data.
savepublic (static)Save an uploaded file to a new location.
sizepublic (static)Validation rule to test if an uploaded file is allowed by file size.
typepublic (static)Validation rule to test if an uploaded file is allowed by extension.
validpublic (static)Tests if input data is valid file type, even if no upload is present.

public required

bool Upload::required ( array $file );

Tests if input data has valid upload data.

public save

string Upload::save ( mixed $file [, string $filename [, string $directory [, integer $chmod ]]] );

Save an uploaded file to a new location.

public size

bool Upload::size ( array $file , array $size );

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 type

bool Upload::type ( array $file , array $allowed_types );

Validation rule to test if an uploaded file is allowed by extension.

public valid

bool Upload::valid ( array $file );

Tests if input data is valid file type, even if no upload is present.