codeigniter, php

renaming file and folders name with codeigniter


if ( ! $this->upload->do_upload())
{
return $this->upload->display_errors();
}
else
{
$res = $this->upload->data();

$file_path     = $res[‘file_path’];
$file         = $res[‘full_path’];
$file_ext     = $res[‘file_ext’];

$final_file_name = time().$file_ext;
 

// here is the renaming functon
rename($file, $file_path . $final_file_name);

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s