Welcome Guest, Not a member yet? Register   Sign In
Weird problem with POST and the upload class
#3

[eluser]deczo[/eluser]
Hi there, i assume you want to insert into db uploaded file location, right?

So you can't use:
Code:
'img'        =>    '/resources/images/' . $this->input->post('img'),
because uploaded file data resides in $_FILES not in $_POST.

Anyway in CI just use upload data helper, part of the upload library:
after upload add:
Code:
$uploadDataArray = $this->upload->data();
then:
Code:
'img'        =>    '/resources/images/' . $uploadDataArray['file_name'],

You can use $uploadDataArray['full_path'] instead, for details check http://ellislab.com/codeigniter/user-gui...ading.html


Messages In This Thread
Weird problem with POST and the upload class - by El Forum - 05-14-2010, 01:29 PM
Weird problem with POST and the upload class - by El Forum - 05-15-2010, 07:05 PM
Weird problem with POST and the upload class - by El Forum - 05-20-2010, 05:32 PM
Weird problem with POST and the upload class - by El Forum - 05-20-2010, 09:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB