[ask] how upload and validate the form |
[eluser]siubie[/eluser]
hi guys iam trying to validate a form here consist of three data two of them are text and the last is a image file. so far when uploading the image file its return an error "You did not select a file to upload." here is my controller : Code: function addSponsor(){ is iam wrong with using a callback ?
[eluser]pistolPete[/eluser]
Where do you set your upload configuration? copied from the userguide: Code: $config['upload_path'] = './uploads/'; Is your upload directory writeable? Is your form field called "userfile"? Also have a look at this thread: http://ellislab.com/forums/viewthread/94736/
[eluser]siubie[/eluser]
i have change my code to this one : Code: function addSponsor(){ and when i add validation rule Code: $this->form_validation->set_rules('gambar', 'Gambar Harus Di Isi', 'trim|required|callback__gambar');
[eluser]TheFuzzy0ne[/eluser]
[url="http://ellislab.com/forums/viewthread/48552/"]This thread[/url] should help you.
|
Welcome Guest, Not a member yet? Register Sign In |