[solved] upload problem - dont see it - pls have a look - 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: [solved] upload problem - dont see it - pls have a look (/showthread.php?tid=65831) |
[solved] upload problem - dont see it - pls have a look - JanFromHamburg - 07-29-2016 Hi, I've got an upload function that should work. Obviously something is wrong. It just reloads the site. I try to upload a png-file with 12kb and I dont get into the "if($this->upload->do_upload()) {". Tryed localhost and on onlineserver. What the hack is it? Any hint or help really appreciated! Controller: PHP Code: ... Model: PHP Code: ... View: Code: ... I tryed "if($this->upload->do_upload('userfile))", but it did not change anything. RE: upload problem - dont see it - pls have a look - ComputingFroggy - 07-29-2016 Just havin a quick look: either an authentification problem or the media parameter is not set. If I were you, I would change redirect(base_url(), 'refresh'); with something like echo 'no login or no parameter'; (just for debugging) to make sure where the problem is. RE: upload problem - dont see it - pls have a look - JanFromHamburg - 07-29-2016 (07-29-2016, 06:05 AM)ComputingFroggy Wrote: Just havin a quick look: either an authentification problem or the media parameter is not set. Thanks, will try, but I do not get a "$this->upload->do_upload() == TRUE", so it stays in the ELSE-part. RE: upload problem - dont see it - pls have a look - spjonez - 07-29-2016 Dear lord your code formatting. I have no idea how you read that. Comment this line out and see what happens: Code: if (!$this->ion_auth->logged_in() || $media==FALSE){redirect(base_url(), 'refresh');} If it still doesn't work, var_dump this line: Code: dirname($_SERVER['DOCUMENT_ROOT']).'/assets/media/'.strtolower($media) Does that path exist and is it writable? If it is, inspect the form tag with dev tools and post it. RE: upload problem - dont see it - pls have a look - JanFromHamburg - 07-29-2016 Yes, following spjonez suggestion, I found out my $config['upload_path'] was wrong. There was a change in the file/folder-system which I had completely forgotten. |