Got a problem with my uploading function

Got a problem with my uploading function

Hi,

i made a function to upload resume on zoho recruit candidates modules with the uploadFile Api Method : https://recruit.zoho.com/recruit/private/xml/Candidates/uploadFile

It returns me : "401Invalid Attachment Type" 

Can anybody helps me ?

here is the function ->

function upload_resume_zoho_recruit() {
        global $wpdb$current_user;
        
        $user_email = $current_user->user_email;
        $key = get_option('zoho_recruit');
        $token = $key['authtoken'];
        $api_url = $key['api_url'];
        $len = count($_FILES);
        $header =['ENCTYPE: multipart/form-data','Content-Type:multipart/form-data;boundary='.(string)$current_time_long];// array('Content-Type: multipart/form-data');
        
        $url = $api_url."/recruit/private/xml/Candidates/uploadFile";
        
        $result = $wpdb->get_row("SELECT * FROM `candidates` WHERE `email` LIKE '".$user_email."'");
        $id = $result->candidate_id;
        
        if ($id != 0) {
            
            $cFile = new CURLFile($_FILES['cvfile']['tmp_name'],$_FILES['cvfile']['type'],$_FILES['cvfile']['name']);
            
            $param = array (
                'authtoken' => $token,
                'scope'     => 'recruitapi',
                'content'   => $cFile,
                'id'        => $id,
                'type'      => 'CVR-aw'
            );
            
            $ch=curl_init();
            curl_setopt($ch,CURLOPT_HEADER,0);
            curl_setopt($ch,CURLOPT_VERBOSE,0);
            curl_setopt($resource, CURLOPT_HTTPHEADER, $header);
            curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
            curl_setopt($ch,CURLOPT_URL,$url);
            curl_setopt($ch,CURLOPT_POST,true);
            curl_setopt($ch,CURLOPT_POSTFIELDS,$param);
            $response=curl_exec($ch);
            
            //send email of API response
            $to = $key['email_log'];
            send_email($to'Zoho Recruit API Logs - uploadFile',$len.' '.$api_url.' '.json_encode($response),$user_email);
        }
        
        return json_decode($response);
     }

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                              • Sticky Posts

                                              • Restriction on 'From' addresses with a public domain

                                                Dear Zoho Recruit Community, We hope this message finds you well. This post is to inform you about some important updates regarding email restrictions within Zoho Recruit. Effective post 30th November 2024, we will be implementing changes to the use of
                                              • Zoho Recruit User Group Meet-up — India 2024

                                                Hello Zoho Recruit users from India, We’re pleased and excited to announce our 2024 edition of Zoho user group meet-up in India in five cities! In this meet-up, our team of experts will help you understand the intricate nuances to use Zoho Recruit better,


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now