Upload image and save file name to database |
[eluser]JaredKC[/eluser]
I am still new to CI and could use a little help. I have a form with a few input text fields and one file field to to upload an image. I have the image uploading and all the other input fields saving to the database, but I have not been able to load the file name and save it to the database. I may be missing something simple, if I am, I hope someone can point it out. Thank you. Here is my code: Form from View file Code: <?php echo form_open_multipart('upload/do_upload');?> Controller Code: <?php Model Code: <?php
[eluser]pistolPete[/eluser]
The filename is not saved in $_POST (which you should not use directly btw --> input class). You can access the data using: Code: $upload_data = $this->upload->data(); Have a look at the user guide.
[eluser]JaredKC[/eluser]
Here is my revised code to make it work incase it helps anyone. Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |