SproutCMS

This is the code documentation for the SproutCMS project

function 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".

Usage

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

Arguments

  1. array $file
    $_FILES item
  2. array $size
    maximum file size

Return value

  • bool