Image Upload Form |
[eluser]Craig N[/eluser]
This is gonna be a pretty noobish post, which makes sense since I'm new to CodeIgniter ![]() I'm working on a form for my first code igniter app. I'm running into a POST issue where the post isn't passing the filename for upload. Here's the code for the form on my view: Code: <?=form_open_multipart('form/image_upload');?> And here's the code in the controller: Code: class Form extends Controller { Code: Array ( [form_id] => 1 ) Any ideas? It's not passing the userfile post variable for some reason, most likely a noobish one ![]() The form is nothing fancy, just a form for people to fill out, upload images and maybe include some fun with AJAX validation later (haven't looked into that with CI yet - are there any plugins that use jquery or other js libraries with CI? Can't imagine so since most are pretty simple already.) edit: I'm using this page in the userguide as a reference - http://ellislab.com/codeigniter/user-gui...ading.html
[eluser]xwero[/eluser]
the name of your file input needs to be userfile if you use $this->upload->do_upload(). If you want to use a self defined name you have to do $this->upload->do_upload('image_name')
[eluser]Craig N[/eluser]
Ahh, I see what you did there. I was including the whole POST variable. Thanks ![]() edit: And of course it's not going to be in the $_POST array - it's in the $_FILES array lol. It's posts like these that keep me humble ![]() |
Welcome Guest, Not a member yet? Register Sign In |