Library Upload not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Library Upload not working (/showthread.php?tid=67353) |
Library Upload not working - jyldisenoweb - 02-13-2017 I have a form to upload an image, but in the controller when I load the library upload and use do_upload () or display_errors (), I get the following message: A PHP Error was encountered Severity: Notice Message: Undefined property: Grupos::$upload Filename: admin/grupos.php Line Number: 66 Fatal error: Call to a member function do_upload() on null in C:\xampp\htdocs\pilloti\application\controllers\admin\grupos.php on line 66 RE: Library Upload not working - ragingTorch - 02-13-2017 It would be better if you can post the controller, view and model code. RE: Library Upload not working - andersonunsonst - 02-14-2017 you don't load the library RE: Library Upload not working - jyldisenoweb - 02-14-2017 (02-14-2017, 02:43 AM)andersonunsonst Wrote: you don't load the library When I put $ this-> load-> library ('upload'); It does not give me any errors, but when I use something from the library itself. RE: Library Upload not working - jyldisenoweb - 02-14-2017 (02-13-2017, 11:21 PM)ragingTorch Wrote: It would be better if you can post the controller, view and model code. View: PHP Code: <form role="form" action="<?php echo base_url(); ?>admin/grupos/guardarGrupo" name="frmNuevoGrupo" id="frmNuevoGrupo" method="post"> Code: $('#frmNuevoGrupo').submit(function(e) { PHP Code: public function guardarGrupo() PHP Code: public function guardarGrupo($nom, $des, $ima) RE: Library Upload not working - InsiteFX - 02-14-2017 The first character of the filename should be upper case. RE: Library Upload not working - jyldisenoweb - 02-14-2017 (02-14-2017, 06:52 AM)InsiteFX Wrote: The first character of the filename should be upper case. Where? RE: Library Upload not working - Wouter60 - 02-14-2017 Load the form helper in the controller before you load the form: PHP Code: $this->load->helper('form'); Then, in your view, open the form with: PHP Code: <?php echo form_open_multipart('admin/grupos/guardarGrupo','id="frmNuevoGrupo"');?> Without multipart, you won't be able to handle upload files. |