SproutCMS

This is the code documentation for the SproutCMS project

function replaceSet()

Replaces a set of files to be stored in a single field; this acts as a backend for Fb::chunkedUpload

Files are saved as '{prefix}{num}.{ext}', with 'num' starting at 1

Usage

array File::replaceSet ( string $session_key , string $field_name , array $exts , string $prefix );

Arguments

  1. string $session_key
    Session key used for this file field, used for FileUpload::verify
  2. string $field_name
    Name of the field used on the form, e.g. 'photos'
  3. array $exts
    Allowed file extensions, e.g. ['jpg', 'jpeg', 'png', 'gif']
  4. string $prefix
    The start of the new file name, e.g. 'user-gallery-123-'

Return value

  • array
    List of newly saved filenames