Function __global->get_upload_error_message

Definitions

sources/uploads.php

  • Get error message for an upload.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$file_upload array No No required parameter N/A N/A The $_FILES array entry
$should_get_something boolean No No True N/A N/A Whether to give a (deferred?) error if no file was given at all
$max_size ?integer No No Null N/A N/A Maximum file size in bytes (null: default from get_max_file_size function)

Returns

  • Error message (null: none)
  • Type: ?Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get error message for an upload.
 *
 * @param  array $file_upload The $_FILES array entry
 * @param  boolean $should_get_something Whether to give a (deferred?) error if no file was given at all
 * @param  ?integer $max_size Maximum file size in bytes (null: default from get_max_file_size function)
 * @return ?Tempcode Error message (null: none)
 */

function get_upload_error_message(array $file_upload, bool $should_get_something = true, ?int $max_size = null) : ?object