return;
} $media->
setAlbum($album);
$media->
setDescription(''
);
$media->
setCreated(new DateTime());
$identity =
$this->
get('auth'
)->
getIdentity();
if ($identity !== null
) { $media->
setUserId($identity->id
);
} else { $media->
setUserId(self::FALLBACK_USER_ID
);
} $this->
Response()->headers->
set('content-type', 'text/plain'
);
try { // Set the upload file into the model. The model saves the file to the directory
$media->
setFile($file);
// Persist the model into the model manager