You are here

public function MetaTagUploadForm::submitForm in Metatag Import Export CSV 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

src/Form/MetaTagUploadForm.php, line 47

Class

MetaTagUploadForm
Form for uploading csv.

Namespace

Drupal\metatag_import_export_csv\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $fid = $form_state
    ->getValue('upload_file')[0];
  $file = File::load($fid);
  $file
    ->setTemporary();
  $file
    ->save();
  $url = $file
    ->getFileUri();
  $filepath = file_create_url($url);
  $this
    ->metatagImportExportCsvUpload($filepath);
}