UploadException example

public const MEDIA_FILE_IS_NOT_INSTANCE_OF_FILE_SYSTEM = 'CONTENT__MEDIA_FILE_IS_NOT_INSTANCE_OF_FILE_SYSTEM';
    public const MEDIA_MISSING_URL_PARAMETER = 'CONTENT__MEDIA_MISSING_URL_PARAMETER';
    public const MEDIA_CANNOT_CREATE_TEMP_FILE = 'CONTENT__MEDIA_CANNOT_CREATE_TEMP_FILE';
    public const MEDIA_FILE_NOT_FOUND = 'CONTENT__MEDIA_FILE_NOT_FOUND';
    public const MEDIA_MISSING_FILE = 'CONTENT__MEDIA_MISSING_FILE';
    public const MEDIA_NOT_FOUND = 'CONTENT__MEDIA_NOT_FOUND';
    public const MEDIA_DUPLICATED_FILE_NAME = 'CONTENT__MEDIA_DUPLICATED_FILE_NAME';

    public static function invalidContentLength(): self
    {
        if (!Feature::isActive('v6.6.0.0')) {
            return new UploadException('Expected content-length did not match actual size.');
        }

        return new self(
            Response::HTTP_BAD_REQUEST,
            self::MEDIA_INVALID_CONTENT_LENGTH,
            'Expected content-length did not match actual size.'
        );
    }

    public static function invalidUrl(string $url): self
    {
        
Home | Imprint | This part of the site doesn't use cookies.