Note that there are some explanatory texts on larger screens.

plurals
  1. POFile upload error cakephp
    primarykey
    data
    text
    <p>When I choose an image and push upload, I get this error in my controller: Notice (8): Undefined index: File [APP/controllers/garage_car_images_controller.php, line 22]</p> <p>I've also noticed that the $form->create line shown below does NOT generate form code in the inspected html. This is VERY weird. </p> <p>Any ideas how to fix this? Thanks!</p> <p>My view code:</p> <pre><code>&lt;div class="title_plate"&gt; &lt;h1 id="title_plate_header"&gt;add image&lt;/h1&gt; &lt;/div&gt; &lt;div id="overlay_content"&gt; &lt;?php echo $form-&gt;create('GarageCarImage', array('controller' =&gt; 'garage_car_images','action' =&gt; 'add', 'type' =&gt; 'file')); echo $form-&gt;file('File'); echo $form-&gt;hidden('garage_car_id', array('value' =&gt; $this-&gt;params['pass'][0])); echo "&lt;br&gt;&lt;br&gt;"; echo "Make this image the default? " . $form-&gt;input('default', array('type' =&gt; 'select', 'label' =&gt; false, 'options' =&gt; array('0' =&gt; 'No', '1' =&gt; 'Yes'))); echo "&lt;br&gt;"; echo $form-&gt;submit('Upload'); echo $form-&gt;end(); ?&gt; &lt;/div&gt; </code></pre> <p>My controller code:</p> <pre><code>if (!empty($this-&gt;data) &amp;&amp; is_uploaded_file($this-&gt;data['GarageCarImage']['File']['tmp_name'])) { $fileData = fread(fopen($this-&gt;data['GarageCarImage']['File']['tmp_name'], "r"), $this-&gt;data['GarageCarImage']['File']['size']); $this-&gt;data['GarageCarImage']['type'] = $this-&gt;data['GarageCarImage']['File']['type']; $this-&gt;data['GarageCarImage']['user_id'] = $this-&gt;Auth-&gt;user('id'); $this-&gt;GarageCarImage-&gt;save($this-&gt;data); } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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