Problem in uploading image - 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: Problem in uploading image (/showthread.php?tid=41653) |
Problem in uploading image - El Forum - 05-13-2011 [eluser]raiser[/eluser] Dear Friends, I tried to upload image.. But couldn't do it.. I followed the user guide to upload. But somewhere i did some mistake. I cannot find it.. Kindly help me.. My code is, View: Code: <?php echo form_open_multipart(''); ?> Controller: Code: class Events_awards extends CI_Controller{ Problem in uploading image - El Forum - 05-13-2011 [eluser]Alur[/eluser] Hello raiser, to begin with, in your view the form should point to the controller: Code: form_open_multipart('events_awards/index') hope it helps! Problem in uploading image - El Forum - 05-13-2011 [eluser]d1a8lo24[/eluser] You're missing the following function Code: $this->upload->do_upload() Also since you're using a different name on your file field you must specified that. Code: $this->upload->do_upload('somefieldname') You can also reference the users guide again http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html All the information is there. Problem in uploading image - El Forum - 05-13-2011 [eluser]d1a8lo24[/eluser] By the way as long as you're using the latest CI version you don't need to specify the uri or controller if it is being submitted to it self. Problem in uploading image - El Forum - 05-16-2011 [eluser]raiser[/eluser] Thanks d1a8lo24 for replying me.. I added Code: $this->upload->do_upload(); Problem in uploading image - El Forum - 05-16-2011 [eluser]d1a8lo24[/eluser] see the following example with your code Code: class Events_awards extends CI_Controller{ Problem in uploading image - El Forum - 05-16-2011 [eluser]raiser[/eluser] Thank you very much d1a8lo24.. Now it is working.. A big thanks Problem in uploading image - El Forum - 05-16-2011 [eluser]d1a8lo24[/eluser] No problemo |