![]() |
uploading picture - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: uploading picture (/showthread.php?tid=65899) Pages:
1
2
|
RE: uploading picture - wolfgang1983 - 08-30-2016 To me your url is not good. Set it using localhost instead of IP Code: $config['base_url'] = 'http://localhost/companygiondaci/'; Use localhost instead of ip address. And for your project folder rename it to lower case Code: www > companygiondaci On your uploads Code: $config['upload_path'] = '.uploads/'; // like Routes Code: $route['cuploadfile/upload'] = 'cuploadfile/upload'; // lower case RE: uploading picture - davy_yg - 08-30-2016 I just tried it and still having the same error message after uploading file: 404 Page Not Found The page you requested was not found. RE: uploading picture - wolfgang1983 - 08-30-2016 (08-30-2016, 12:38 AM)davy_yg Wrote: I just tried it and still having the same error message after uploading file: Did you try it with index.php in URL Code: http://localhost/companygiondaci/index.php/cuploadfile/upload Also name the file and class with first letter upper case ONLY as required Code: controllers/Cuploadfile.php RE: uploading picture - davy_yg - 08-30-2016 controllers/Cuploadfile.php PHP Code: class Cuploadfile extends CI_Controller { I tested the upload picture. It stays on the same page yet it does not copy the picture to folder /uploads/ RE: uploading picture - salain - 08-30-2016 Have you fix your form tag as it was wrong in one of your first post. you posted: PHP Code: <?php echo form_open_multipart('uploadfile/upload');?> It should be: PHP Code: <?php echo form_open_multipart('cuploadfile/upload');?> RE: uploading picture - davy_yg - 08-30-2016 How to fix this error message? Another error message appears:
A PHP Error was encountered Severity: Notice Message: Undefined variable: images Filename: views/addslideshows.php Line Number: 103 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\views\addslideshows.php Line: 103 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\controllers\Cuploadfile.php Line: 36 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\index.php Line: 315 Function: require_once A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: views/addslideshows.php Line Number: 103 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\views\addslideshows.php Line: 103 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\application\controllers\Cuploadfile.php Line: 36 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\companygiondaci\index.php Line: 315 Function: require_once ------------------------------------------------- views/addslideshows.php PHP Code: <?php foreach ($images as $images_item): ?> controllers/Cpages.php PHP Code: public function addslideshows() { RE: uploading picture - salain - 08-30-2016 your call to : PHP Code: $data['images'] = $this->Mpages->call_slideshow(); Does not return what you expect. What is the code for the method? RE: uploading picture - wolfgang1983 - 08-30-2016 (08-30-2016, 01:45 AM)davy_yg Wrote: How to fix this error message? Try on controller PHP Code: <?php You should var_dump your model function in your return of model you may need to use return $query->result_array() PHP Code: <?php if ($images) {?> RE: uploading picture - davy_yg - 09-12-2016 http://localhost/companygiondaci/index.php/cpages/editgalleries/2 array(1) { ["gallery"]=> array(1) { [0]=> array(2) { ["galleries_id"]=> string(1) "2" ["galleries_name"]=> string(8) "gallery1" } } } controllers/Cpages.php public function editgalleries() { $id = $this->uri->segment(3); $data['gallery'] = $this->Mpages->edit_gallery($id); var_dump($data); // Check if any results are actually there. $this->load->view('editgalleries', $data); } |