Problem in uploading image |
[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{
[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!
[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-gui...ading.html All the information is there.
[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.
[eluser]raiser[/eluser]
Thanks d1a8lo24 for replying me.. I added Code: $this->upload->do_upload();
[eluser]d1a8lo24[/eluser]
see the following example with your code Code: class Events_awards extends CI_Controller{
[eluser]raiser[/eluser]
Thank you very much d1a8lo24.. Now it is working.. A big thanks
|
Welcome Guest, Not a member yet? Register Sign In |