Png Images uploaded using api wont preview, only downloads to client

Hey @Brian_Clinton,

I’m sharing some code that is working and maybe can help you. Ignore the resizing part.

 $filename = basename($data['photo']);
 $path = public_path('photo_tmp') . '/'. $filename;
 $type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);
 $image = \Image::make($path)->resize(150, 150)->save($path)->destroy();

 $client->attachments->createOnTask(
     $task->id,
     file_get_contents($path),
     $filename,
     $type
   );