EllisLab text mark
Advanced Search
     
Problem with Upload config file_name
Posted: 30 November 2010 02:39 PM   [ Ignore ]
Avatar
Joined: 2008-06-12
20 posts

I’m experiencing a problem with the changing the file name within the upload config array. My code is as follows;

$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

./uploads[allowed_types] => csv [file_name] => test.csv [overwrite] => [remove_spaces] => 

Checking the uploaded data I get the following:

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.