CodeIgniter Forums
Problem with Upload config file_name - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with Upload config file_name (/showthread.php?tid=36403)



Problem with Upload config file_name - El Forum - 11-30-2010

[eluser]old_guy[/eluser]
I'm experiencing a problem with the changing the file name within the upload config array. My code is as follows;
Code:
$config= array(
            'upload_path'=> './uploads/',
            'allowed_types'=> 'csv',
            'file_name'=> 'test.csv',
            'overwrite'=> FALSE,
            'remove_spaces'=> TRUE,
            );
$this->load->library('upload', $config);
The upload function works fine. The $conifg array contains the right file name
Code:
./uploads/ [allowed_types] => csv [file_name] => test.csv [overwrite] => [remove_spaces] => 1 )

Checking the uploaded data I get the following:
Code:
Array
(
    [file_name] => csvTest.csv
    [file_type] => text/tsv
    [raw_name] => csvTest
    [orig_name] => csvTest.csv
    [file_ext] => .csv
)
The file name does not change. The file gets uploaded with its original name.

Any help discovering why this is occurring would be greatly appreciated.