move($image_storage_folder, $file_name, true); return $image_storage_folder . $file_name; } /** * Gets audio file metadata and ID3 info * * @param UploadedFile $file * * @return array */ function get_file_metadata($file) { if (!$file->isValid()) { throw new RuntimeException( $file->getErrorString() . '(' . $file->getError() . ')' ); } $getID3 = new GetID3(); $FileInfo = $getID3->analyze($file); return [ 'cover_picture' => $FileInfo['comments']['picture'][0]['data'], 'filesize' => $FileInfo['filesize'], 'mime_type' => $FileInfo['mime_type'], 'playtime_seconds' => $FileInfo['playtime_seconds'], ]; }