Upload Model issues. - 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: Upload Model issues. (/showthread.php?tid=1342) |
Upload Model issues. - miiikkeyyyy - 03-01-2015 I am creating an upload script for my signed in users. Libraries included: form, upload and image_lib. From the controller I want to call upon the add image function, from the user model. From the user model I want it to attempt to upload the file using the upload model. And once the upload is complete I want the user model to create the thumbnails and add to database. I get a dreaded The upload path does not appear to be valid. every single time. I know the path works as I wrote echo $config['upload_path'] and copied the result in my browser and it took me to the directory. Could someone shed some light on why I always get the error? In my controller/profile.php I have: PHP Code: if($this->input->post()) In my models/user_model.php I have: PHP Code: function add_image() In my models/upload_model.php I have: PHP Code: function upload($config) RE: Upload Model issues. - mwhitney - 03-05-2015 In models/upload_model.php, before: PHP Code: if ($this->upload->do_upload()) you probably need to add: PHP Code: $this->load->library('upload', $config); Otherwise, wherever you're loading the upload library is where you're getting the $config values, so your upload path is probably set to a default value rather than the $config value you're passing to your model. |