CodeIgniter Forums
Another simple Upload Class question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Another simple Upload Class question (/showthread.php?tid=33783)



Another simple Upload Class question - El Forum - 09-08-2010

[eluser]thesocialhacker[/eluser]
Why can't I get "file_name" out of this...?
Code:
$upload_data = array('upload_data' => $this->upload->data());

Unindexed Array, file_name not found... I can't simply use $upload_data['full_path'] or $upload_data['file_name'] or any of them, for that matter- I'm using the example code found on the CI site (http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html)

Code:
Array ( [upload_data] => Array ( [file_name] => pseudo-vector8.jpg [file_type] => image/jpeg [file_path] => /public_html/beatjunkie/code/frontend/thesocialhacker/ [full_path] => /public_html/beatjunkie/code/frontend/thesocialhacker/pseudo-vector8.jpg [raw_name] => pseudo-vector8 [orig_name] => pseudo-vector.jpg [client_name] => pseudo-vector.jpg [file_ext] => .jpg [file_size] => 5.63 [is_image] => 1 [image_width] => 80 [image_height] => 123 [image_type] => jpeg [image_size_str] => width="80" height="123" ) )



Another simple Upload Class question - El Forum - 09-08-2010

[eluser]thesocialhacker[/eluser]
here is the actual err:
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: file_name

Filename: controllers/upload.php

Line Number: 54

line 54 is where I use $upload_data['file_name'];


Another simple Upload Class question - El Forum - 09-08-2010

[eluser]thesocialhacker[/eluser]
duh,
Code:
$upload_data = $this->upload->data();
instead of building the array() to $data... thanks anyway Wink