php - Saving a remote image from facebook graph api -


any idea what's wrong? end 1bytes files , wrong. using intervention image & php. tried many ways nothing... if want display works can't save picture...

$avatar_url     = 'http://graph.facebook.com/' . $id . '/picture?type=square&width=140&height=140&redirect=false';                     $avatar_pic_url = json_decode(file_get_contents($avatar_url), true)['data']['url'];                     dd($avatar_pic_url);                     $avatar         = image::make($avatar_pic_url);                     $extension      = 'jpg';                     // save                     $destinationpath        = 'uploads/avatars/';                     $filename               = uniqid(). '.' . $extension;                     $path_to_temp_image     = $avatar->dirname . '/' . $avatar->filename;                     $key                    = $destinationpath . $filename;                     // upload avatar remote storage                     $uploadsuccess = storage::put($key, $path_to_temp_image); 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -