CodeIgniter Forums
Upload Data File Name - 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: Upload Data File Name (/showthread.php?tid=14403)



Upload Data File Name - El Forum - 01-01-2009

[eluser]Bl4cKWid0w[/eluser]
I am trying to make a profile form which allows a user to upload a photo. I got the actual upload to work, but now I can't figure out how to get the name of the file. I need the name of the file so I can update the user's database information. I tried using $this->upload->data('file_name') to get it, but it returns a database error saying something about the array in the column name.


Upload Data File Name - El Forum - 01-01-2009

[eluser]xwero[/eluser]
the upload->data method generates an array with information about the uploaded file.


Upload Data File Name - El Forum - 01-01-2009

[eluser]Bl4cKWid0w[/eluser]
Yes, I am aware of that. But usually to display an array, you assign it to a variable... such as $file = array('file_name' => ''); and then display it with $file['file_name']. What is the title of this array is what I am getting at.


Upload Data File Name - El Forum - 01-01-2009

[eluser]xwero[/eluser]
that is how you do it with the method too
Code:
$data = $this->upload->data();