Solved: It does not upload... who does see it? ( CI File Upload Class) |
[eluser]Jan_1[/eluser]
I'm trying to upload an image. It works at another modul in my application. Everything is the same (of course not url's). What am I doing wrong? Trying to find out since 6 hours. After using upload-button it stays in the (!$this->upload->do_upload())-area without effect and without errors-printout. Could anyone give me a help? Or may be you have a hint how to find the mistake or a good question to me. Every help wanted. Thank you!!!! controller suche_in.php: Code: function do_upload() Code: <div id=headline><?=$heading?></div> View upload_success.php Code: <div id=headline>Bestätigung:</div>
[eluser]Cro_Crx[/eluser]
Only the second parameter of the view() function takes in data. The third is used for another purpose (sends view to buffer/variable). So you can't do this: Code: $this->load->view($this->_container, $data, $error); Just pass error as an array element of data. Change this line Code: $error = array('error' => $this->upload->display_errors()); to this Code: $data['error'] = $this->upload->display_errors(); And this line: Code: $this->load->view($this->_container, $data, $error); to this: Code: $this->load->view($this->_container, $data);
[eluser]Jan_1[/eluser]
Thank you!!! Now I get error-messages. It' says "You did not select a file to upload."
[eluser]Cro_Crx[/eluser]
Check the do_upload() funciton in the user guide ==> http://ellislab.com/codeigniter/user-gui...ading.html Says that the file input needs to have the name 'userfile'. You've got your set to 'inserat' in the view. So you can either change it to 'userfile' or pass in your file input name to the do_upload function like this: Code: if ( ! $this->upload->do_upload('inserat'))
|
Welcome Guest, Not a member yet? Register Sign In |