(06-29-2018, 10:24 AM)Nome Wrote: Sorry... Perhaps this is too simple a question: How to get the full name of the file at uploading?
Example:
picture.jpg
$file->getBasename()
since I noticed that the temporary file name is returned...
Thanks!
Using the example code below, create a variable using the line of code you created for the upload path, then concatenate with the file name. The example variable below is $imagepath. This variable will represent the full path to your file.
Code:
public function do_upload()
{
$config['upload_path'] = 'public/uploads/';
$config['allowed_types'] = 'jpg|png';
$config['max_size'] = 100;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$this->load->library('upload', $config);
// The $imagepath variable holds the full path to the file
$imagepath = $config['upload_path'].$this->upload->data('file_name');