Note that there are some explanatory texts on larger screens.

plurals
  1. PO"Notice (8): Undefined index: " cakephp
    primarykey
    data
    text
    <p>I am building a pdf conversion utility for my user. I am working in <code>CakePhp</code> and my controller is receiving Ajax call. Why i am getting <strong>Notice:8</strong> error </p> <p><strong>Controller:</strong></p> <pre><code>public function convertToPdf() { $this-&gt;autoRender = false; $pdf = new WkHtmlToPdf; //$this-&gt;RequestHandler-&gt;respondAs('json'); // echo $convertData = json_encode($inputVal); if ($this-&gt;RequestHandler-&gt;isAjax()) { $pdfName = uniqid(); if ($_FILES['conversionSourceFile']) { echo "File"; $pdf-&gt;addPage($_FILES['conversionSourceFile']['tmp_name']); } elseif ($_POST['conversionSourceUrl']) { echo "Url"; $pdf-&gt;addPage($_POST['conversionSourceUrl']); } elseif ($_POST['conversionSourceHtml']) { echo "Html"; $pdf-&gt;addPage('&lt;html&gt;' . $_POST['conversionSourceHtml'] . '&lt;/html&gt;'); } $saveToPath = 'upload/' . $pdfName . '.pdf'; if ($pdf-&gt;saveAs($saveToPath)) { echo 'upload/' . $pdfName . '.pdf'; } } } </code></pre> <p><strong>Error:</strong> Notice (8): Undefined index: conversionSourceFile [APP/Controller/PdfsController.php, line 42] Code Context</p> <pre><code>if ($this-&gt;RequestHandler-&gt;isAjax()) { $pdfName = uniqid(); if ($_FILES['conversionSourceFile']) { PdfsController::convertToPdf() - APP/Controller/PdfsController.php, line 42 ReflectionMethod::invokeArgs() - [internal], line ?? Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 486 Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 187 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 162 [main] - APP/webroot/index.php, line 109 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload