![]() |
Upload function not running - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Upload function not running (/showthread.php?tid=24246) |
Upload function not running - El Forum - 11-04-2009 [eluser]überfuzz[/eluser] I'm building a simple form to mail script. It's supposed to attach a userfile to the mail. Code: function index() Edit, What am I doing wrong here? Upload function not running - El Forum - 11-04-2009 [eluser]Flemming[/eluser] Don't you need to use Code: $this->email->attach() Edit: sorry - is the upload not working at all? Have you set the enctype of the form correctly? Upload function not running - El Forum - 11-04-2009 [eluser]umefarooq[/eluser] hi pass form file name to then it will upload you files and also you call your class parameters properly Code: $test = $this->do_upload(); Upload function not running - El Forum - 11-04-2009 [eluser]überfuzz[/eluser] [quote author="flemming" date="1257351993"]Don't you need to use Code: $this->email->attach() Edit: sorry - is the upload not working at all? Have you set the enctype of the form correctly?[/quote] I think so. form_open_multipart('test') gives: Code: <form action="http://www.-----.com/test" method="post" enctype="multipart/form-data"> Upload function not running - El Forum - 11-04-2009 [eluser]überfuzz[/eluser] [quote author="umefarooq" date="1257352180"]hi pass form file name to then it will upload you files and also you call your class parameters properly Code: $test = $this->do_upload(); Its stated in the user_guide that upload will assume that there is a field called userfile. So the call should work without passing the field name Upload function not running - El Forum - 11-04-2009 [eluser]umefarooq[/eluser] yes it will work fine if you field name is "userfile" that is default filename parameter in upload library if you defining you own field name just like upload or uploadfile then you have to give field name as parameter in do_upload() function you can check user_guide it is also there |