Fixed image exporting
This commit is contained in:
parent
6a6987fe33
commit
cec01d3d02
|
@ -1097,17 +1097,6 @@ class UserController extends Controller
|
|||
$userData = $user->toArray();
|
||||
$userData['links'] = $links->toArray();
|
||||
|
||||
function findAvatar($name){
|
||||
$directory = base_path('assets/img');
|
||||
$files = scandir($directory);
|
||||
$pathinfo = "error.error";
|
||||
foreach($files as $file) {
|
||||
if (strpos($file, $name.'.') !== false) {
|
||||
$pathinfo = "/img/" . $name. "." . pathinfo($file, PATHINFO_EXTENSION);
|
||||
}}
|
||||
return $pathinfo;
|
||||
}
|
||||
|
||||
if (file_exists(base_path(findAvatar($userId)))){
|
||||
$imagePath = base_path(findAvatar($userId));
|
||||
$imageData = base64_encode(file_get_contents($imagePath));
|
||||
|
|
Loading…
Reference in New Issue