Hi People;
I've got issue in uploading image in cake php.
Thing is that, I have a form, where i have input type="file".
I need to upload a file in a directory and save its path in database.
In "view" its like...
<tr><td>
<?php echo $this->Form->input('field', array(
'type' => 'file',
'label' => 'Please Upload Signature of Sales Manager'
));
?>
</td></tr>
and in the "Controller" its like
$dir = WWW_ROOT.'documents';
$slas= '\\';
$filenamez= $this->data['Invoice']['field']['name'];
$dir=$dir.$slas.$filenamez;
echo $dir;
move_uploaded_file($this->data['Invoice']['field']['tmp_name'],$dir);
I'm getting this error....
SQL Query: UPDATE `acm`.`invoices` SET `last_modified` = '2013-06-24 10:10:16', `last_mod_by` = 'Admin User', `invoice_number` = '1306190003', `invoice_date` = '2013-06-19', `invoice_total` = 316.00, `sales_manager` = 'Lucius Fox', `status` = 'Part Paid', `public_notes` = 'We appreciate your business.\r\nRefer the above order in accordance with the prices, terms and other specifications listed above.', `private_notes` = '', `field` = Array WHERE `acm`.`invoices`.`id` = '3'
How to insert the uploaded file path in database?
Thanks