Maximum upload size ~
Enter the maximum file size that can be uploaded via the file manager. Upload file size must be entered in bytes. <strong>NOTE: Large files can take a very long time to upload!</strong>

@param string $value

@return $this
170698
public function setCoreUploadMaxsize($value)
    {
        $this->setFieldName('upload_maxsize');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1248102
protected function validateValueSize($value){

		// Serialize the value being saved to get a byte-stream string.
		// Strlen returns number of bytes in a string.
		$size = strlen(serialize($value));

		// The limit for values is 4 MB.
		$allowed = 1024 * 1024 * 4;
		if($size > $allowed){

			return false;
		}

		return true;
	}
765906
public function setCoreUploadFiles($value)
    {
        $this->setFieldName('upload_files');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
241868
public function setSharedMaxAge($value)
    {
        $this->addCacheControlDirective('public');
        $this->removeCacheControlDirective('private');
        $this->addCacheControlDirective('s-maxage', $value);

        return $this;
    }
616041
public function pad(int $size, $value): self
    {
        return new static(array_pad($this->storage, $size, $value));
    }
636881
public function validate($value)
    {
        // The value which comes in is a files array so we can look through this
        // to and then get the files to test aspects of them.
        if (isset($value['Files'])) {
            foreach($value['Files'] as $fileID) {
                $file = File::get()->byId($fileID);

                // Now have the file double-check it is an image and if so then
                // get some information about the image using PHPs getimagesize()
                if ($file->ClassName == 'Image') {
                    $info = getimagesize(BASE_PATH . "/" . $file->Filename);

                    if ($info && is_array($info)) {
                        $width = $info[0];
                        $height = $info[1];

                        switch ($this->type) {
                            case self::WIDTH:
                                return $width == $this->val1;
                                break;
                            case self::HEIGHT:
                                return $height == $this->val1;
                                break;
                            case self::WIDTH_HEIGHT:
                                return (($width == $this->val1) && ($height == $this->val2));
                                break;
                            case self::RATIO:
                                $baseWidth = floor($width / $this->val1);
                                $baseHeight = floor($height / $this->val2);
                                return $baseWidth == $baseHeight;
                                break;
                            case self::MIN_WIDTH:
                                return $width >= $this->val1;
                                break;
                            case self::MIN_HEIGHT:
                                return $height >= $this->val1;
                                break;
                            case self::MIN_WIDTH_HEIGHT:
                                return (($width >= $this->val1) && ($height >= $this->val2));
                                break;
                            case self::MAX_WIDTH:
                                return $width <= $this->val1;
                                break;
                            case self::MAX_HEIGHT:
                                return $height <= $this->val1;
                                break;
                            case self::MAX_WIDTH_HEIGHT:
                                return (($width <= $this->val1) && ($height <= $this->val2));
                                break;
                            default:
                                throw new Exception('Invalid type : ' . $this->type);
                        }
                    }
                }
            }
        } else {
            // Return true so if no file selected then not shown validation message
            // when the field is optional. If required dev should add to required fields as well.
            return true;
        }
    }
1069849
public function writeLong($value)
    {
        // We do not need to check if file position points to the end of "file".
        // Only append operation is supported now

        /**
         * Check, that we work in 64-bit mode.
         * fseek() and ftell() use long for offset. Thus, largest index segment file size in 32bit mode is 2Gb
         */
        if (PHP_INT_SIZE > 4) {
            settype($value, 'integer');
            $this->_data .= chr($value>>56 & 0xFF) .
                            chr($value>>48 & 0xFF) .
                            chr($value>>40 & 0xFF) .
                            chr($value>>32 & 0xFF) .
                            chr($value>>24 & 0xFF) .
                            chr($value>>16 & 0xFF) .
                            chr($value>>8  & 0xFF) .
                            chr($value     & 0xFF);
        } else {
            $this->writeLong32Bit($value);
        }

        $this->_position = strlen($this->_data);
    }
834355
function add($value) {
        if(!\in_array($value, $this->data, true)) {
            $this->data[] = $value;
        }
        
        return $this;
    }
786956
public function uploadErrors($value, $options = []) {
		$defaults = [
			'allowNoFileError' => true
		];
		if (is_array($options)) {
			$options = array_merge($defaults, $options);
		} else {
			$options = $defaults;
		}
		if (isset($value['error']) && ($value['error'] !== null)) {
			switch ($value['error']) {
				case UPLOAD_ERR_OK:
					return true;
				case UPLOAD_ERR_INI_SIZE:
					$this->_uploadError = __d('file_storage', 'The uploaded file exceeds limit of %s.', Number::toReadableSize(ini_get('upload_max_filesize')));

					return false;
				case UPLOAD_ERR_FORM_SIZE:
					$this->_uploadError = __d('file_storage', 'The uploaded file is to big, please choose a smaller file or try to compress it.');

					return false;
				case UPLOAD_ERR_PARTIAL:
					$this->_uploadError = __d('file_storage', 'The uploaded file was only partially uploaded.');

					return false;
				case UPLOAD_ERR_NO_FILE:
					if ($options['allowNoFileError'] === false) {
						$this->_uploadError = __d('file_storage', 'No file was uploaded.');

						return false;
					}

					return true;
				case UPLOAD_ERR_NO_TMP_DIR:
					$this->_uploadError = __d('file_storage', 'The remote server has no temporary folder for file uploads. Please contact the site admin.');

					return false;
				case UPLOAD_ERR_CANT_WRITE:
					$this->_uploadError = __d('file_storage', 'Failed to write file to disk. Please contact the site admin.');

					return false;
				case UPLOAD_ERR_EXTENSION:
					$this->_uploadError = __d('file_storage', 'File upload stopped by extension. Please contact the site admin.');

					return false;
				default:
					$this->_uploadError = __d('file_storage', 'Unknown File Error. Please contact the site admin.');

					return false;
			}

			return false;
		}
		$this->_uploadError = '';

		return true;
	}
1089395
public function sizeMax($sizeMax = 1048576, $error) {
        if ($this->_exist) {
            array_push($this->_constraints, ['type' => self::SIZEMAX, 'value' => $sizeMax, 'message' => $error]);
        }

        return $this;
    }
1108442
public function initFromInteger($value)
    {
        $this->a = ($value >> 24) & 0xFF;
        $this->r = ($value >> 16) & 0xFF;
        $this->g = ($value >> 8) & 0xFF;
        $this->b = $value & 0xFF;

        return $this;
    }
1298564
public function setMaxCol($value)
    {
        if ($value != null) {
            $this->_params['max-col'] = $value;
        } else {
            unset($this->_params['max-col']);
        }
        return $this;
    }
4699
public function addAddition($value)
    {
        $this->data->amount->subtotals->addition += $this->convertAmount($value);

        return $this;
    }
1126306
public function validateRequired($value)
    {
        // Check for file!
        if (true === is_array($value) && true === array_key_exists('tmp_name', $value)) {
            // At least it was uploaded its valid in meaning of "required" <= NOT EMPTY
            $valid = ($value['error'] < UPLOAD_ERR_PARTIAL);
        } else {
            // Plain value ...
            $valid = (!is_null($value) && (is_array($value) || is_object($value) || (strlen($value) > 0)));
        }

        return $valid;
    }
1237241
public function setCorePhpthumbCacheMaxsize($value)
    {
        $this->setFieldName('phpthumb_cache_maxsize');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1211550
public function setValue( $value ) {
		if ( strtolower( $this->tag ) === 'textarea' ) {
			$this->clearContent();
			$this->appendContent( $value );
		} else {
			$this->setAttributes( [ 'value' => $value ] );
		}
		return $this;
	}
376588
protected function aboveMaxBorder($value): bool
    {
        if (null === $this->maxLength) {
            return false;
        }

        return $this->length($value) > $this->maxLength;
    }