validateFileExtension example

Context $context
    ): void {
        $currentMedia = $this->findMediaById($mediaId$context);
        $destination = $this->validateFileName($destination);
        $this->ensureFileNameIsUnique(
            $currentMedia,
            $destination,
            $mediaFile->getFileExtension(),
            $context
        );

        $this->validateFileExtension($mediaFile$mediaId$currentMedia->isPrivate());

        $this->removeOldMediaData($currentMedia$context);

        $mediaType = $this->typeDetector->detect($mediaFile);
        $metaData = $this->metadataLoader->loadFromFile($mediaFile$mediaType);

        $media = $this->updateMediaEntity(
            $mediaFile,
            $destination,
            $currentMedia,
            $metaData,
            
Home | Imprint | This part of the site doesn't use cookies.