[eluser]Unknown[/eluser]
HI, does anyone know how I can assign the current date & time to a file name when using the file upload class.
My current code is:
Code:
function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2048';
$config['max_width'] = '1624';
$config['max_height'] = '1268';
$config['file_name'] = substr(md5(time()), 0, 28);
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
//$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
}
Any help much appreciated.