You are here

public function MediaUploaderInterface::upload in Gutenberg 8.2

Same name and namespace in other branches
  1. 8 src/MediaUploaderInterface.php \Drupal\gutenberg\MediaUploaderInterface::upload()

Upload media to the filesystem.

Parameters

string $form_field_name: A string that is the associative array key of the upload form element in the form array.

\Symfony\Component\HttpFoundation\File\UploadedFile $uploaded_file: Uploaded file instance.

\Drupal\editor\Entity\Editor $editor: Editor entity.

array $file_settings: A list of file configurations. e.g. 'file_extensions' etc.

Return value

\Drupal\file\Entity\File|null File entity or null on failure.

1 method overrides MediaUploaderInterface::upload()
MediaUploader::upload in src/MediaUploader.php
Upload media to the filesystem.

File

src/MediaUploaderInterface.php, line 31

Class

MediaUploaderInterface
Provides media upload for Gutenberg editor.

Namespace

Drupal\gutenberg

Code

public function upload(string $form_field_name, UploadedFile $uploaded_file, Editor $editor, array $file_settings = []);