Skip to content

Instantly share code, notes, and snippets.

@alexander-schranz
Last active November 28, 2016 08:12
Show Gist options
  • Select an option

  • Save alexander-schranz/8cb3543b1b7748deec3a8b7d3f592aad to your computer and use it in GitHub Desktop.

Select an option

Save alexander-schranz/8cb3543b1b7748deec3a8b7d3f592aad to your computer and use it in GitHub Desktop.
SuluMediaImport.php
<?php
$uploadedFile = new UploadedFile(
$filePath, $name, $mimeType, $size
);
$media = $this->getContainer()->get('sulu_media.media_manager')->save(
$uploadedFile,
[
'locale' => $locale,
'title' => $title,
'collection' => $collectionId,
],
$userId
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment