$iSize = getimagesize($photo); $data['source'] = new CURLFile($photo, $iSize['mime'], basename($photo));