asciisd / zoho

Zoho package for Laravel
36 stars 36 forks source link

Error on to uploadAttachment #31

Closed developer-conexaog closed 2 years ago

developer-conexaog commented 2 years ago

I'm trying to attach documents to a business, but I'm in error. "Please check if the URL trying to access is a correct one" The server path is correct, does anyone have any examples?

my code /Create Business in Zoho / $potentialsZoho = ZohoManager::useModule('Potentials'); // dd($potentialsZoho->getRecords()); $record = $potentialsZoho->getRecordInstance(); $record->setFieldValue('Description', 'Created by Quote:' . $quotation->cod); $record->setFieldValue('Deal_Name', 'Quotation:' . $quotation->cod); $record->setFieldValue('Account_Name', $accountZoho->getEntityId()); $record->setFieldValue('Stage', 'Proposal Budget/Price'); $record->setFieldValue('Contact_Name', $clientsZoho->getEntityId()); $record->setFieldValue('Expected_Revenue', $order->create_at); $record->setFieldValue('Type','New Business'); $record->setFieldValue('Lead_Source',getenv('APP_NAME'));

        $quotController = new QuotationsController();

        $quotController->printQuotation($quotation->id,true);
       // dd(realpath(str_replace("/\/", "/",public_path().'/pdf/quotation'.$quotation->id.'.pdf')));
        $record->uploadAttachment( (realpath(str_replace("/\/", "/",public_path().'/pdf/quotation'.$quotation->id.'.pdf'))));

        $potentialsZoho = $record->create()->getData();
developer-conexaog commented 2 years ago

I got it, I just registered the record before. I inverted before creating potentialsZoho