public function __construct($htmlName, $code = 0, \Exception $pex = null) { parent::__construct($htmlName, $code, $pex); if (SecurityConcernException::NOT_UPLOADED === $code) { $this->message = 'The file was not uploaded through POST'; } else { if (SecurityConcernException::UNKNOWN_CODE <= $code) { $code -= SecurityConcernException::UNKNOWN_CODE; $this->message = "The file had an unknown PHP upload error code: {$code}"; } } }
public function __construct($htmlName, $code = 0, \Exception $pex = null) { parent::__construct($htmlName, $code, $pex); switch ($code) { case UPLOAD_ERR_NO_TMP_DIR: $this->message = 'No temporary folder in which to hold the upload'; break; case UPLOAD_ERR_CANT_WRITE: $this->message = 'Failed to write upload to temporary location'; break; case UPLOAD_ERR_EXTENSION: $this->message = 'An extension blocked the upload'; break; case ServerProblemException::MOVE_UPLOAD_FAILED: $this->message = 'Unable to move upload'; break; } }
public function __construct() { $_['title'] = kgettext('Uploads.'); $_['text'] = kgettext('Unknown upload type.'); $_['image'] = Config::DIR_PATH . '/img/exceptions/default.png'; $this->message_data = $_; parent::__construct($_['text']); }