Optional file upload - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: Optional file upload (/showthread.php?tid=704) |
Optional file upload - PolatAlemdar - 01-07-2015 first question: Why the file upload in COdeigniter is not optional so that I need to make a trick? Second one: In this code below If I select a file it says "You did not select a file to upload." and doesn't upload. I have title,text,date and file fields in the form. If I don't select a file there is no problem. Can you help me solve that? PHP Code: public function create() RE: Optional file upload - mwhitney - 01-07-2015 This is a shot in the dark, but did you use form_open_multipart() in your view, or just form_open()? RE: Optional file upload - PolatAlemdar - 01-08-2015 PHP Code: <?php if (isset($error)) echo $error;?> Yes I had. RE: Optional file upload - mwhitney - 01-08-2015 Try changing $this->upload->do_upload() to $this->upload->do_upload('dosya') RE: Optional file upload - PolatAlemdar - 01-09-2015 thank you for help. solved now. I changed the upload path to $config['upload_path'] = dirname($_SERVER["SCRIPT_FILENAME"]).'/files/makaleler/'; |