Used to upload file .
App::Utility()->text2normalize(ImgInfo,Path);
Parameter |
Description |
---|---|
ImgInfo |
Image data from $_FILES, |
Path |
Path to update data. |
If file already exits in the folder then current time stamp add in file name to make it unique.
See bellow example:
// $this->data['Category']['image'] is like $_FILES['image']
$file_path = App::Config()->baseDir("/uploads/");
App::Utility()->Upload($this->data['Category']['image'],$file_path);
/*
Return
array(
'file_name' => 'logo.jpg',
'file_name2' => 'logo'
}