Attach images to new Zoho Desk ticket

Attach images to new Zoho Desk ticket

Hi all,
I am trying to attach images to a ticket.  I am using PHP and the Desk API and am able to create the ticket fine.  When I try to attach an image using the below code, there is nothing in the response..  it is just empty and nothing is attached to the ticket.  I have confirmed the image file URLs are accessible. Is there a better way I should do this on ticket creation (as the images are ready when the ticket is created)?  What is wrong with my code?
Thanks,
Alex.
  1. public function attachFiles($ticketid, $images)

        {

            $access_token = $this->get_access_token();

            if(isset($images) && !empty($images)){

                foreach($images as $key => $image) {

                    $ch_image = curl_init();

                    curl_setopt( $ch_image, CURLOPT_URL, 'https://desk.zoho.com.au/api/v1/tickets/'.$ticketid.'/attachments?isPublic=true' );

                    curl_setopt( $ch_image, CURLOPT_POST, true );

                    $post_fields = array(

                        'file' => new CURLFile($image)

                    );

                    curl_setopt($ch_image, CURLOPT_POSTFIELDS, $post_fields);

                    curl_setopt($ch_image, CURLOPT_RETURNTRANSFER, true);

                    curl_setopt( $ch_image, CURLOPT_HTTPHEADER, array(

                        'Authorization: Zoho-oauthtoken ' . $access_token,

                        'orgId: ******',

                        'Content-Type:multipart/form-data'

                    ) );

                    

                    $img_response = curl_exec( $ch_image );

                    curl_close($ch_image);

                    $image_upload_response = json_decode($img_response, true);

                    print_r($image_upload_response);  //this is empty!?

                }

            }