CodeIgniter Forums

Full Version: $this->upload->$data, trouble accessing array items
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]benmanson[/eluser]
Hi,

I am having trouble with what is probably a simple problem. I am trying to access the [file_name] and [file_path] items in the array $this->upload->data() that is produced when uploading files.

Can anyone point out how to do it? I have tried using a foreach loop and also using the array helper element() function. But I just can't seem to get it.

thanks
Ben

El Forum

[eluser]steelaz[/eluser]
This is how I did it, but I'm no expert. Also I'm uploading one file at a time.

Code:
$aFile = $this->upload->data();
$sPath = $aFile['full_path'];

El Forum

[eluser]benmanson[/eluser]
thanks steelaz - perfect, just what I needed. I knew it would be simple, just couldn't get it.

El Forum

[eluser]dark_lord[/eluser]
Nice answer stellaz! Thanks dude!