Welcome Guest, Not a member yet? Register   Sign In
uploading class - change upload data array
#1

Hi

PHP Code:
$this->upload->data(); 

After upload, i check the file width, if it is more than 500, then i resize it. 

PHP Code:
if($this->image_lib->resize()) {
$this->upload->data()['file_name'] = $this->upload->data()['raw_name']."_thumb.".$this->upload->data()['file_ext'];
}

return 
$this->upload->data(); 


But it is not chaning the file name. So i am getting upload data. If there is a resize, how to change or get the resized file properties? 
Reply
#2

You can't change output of function directly, you need to save it to variable first, otherwise it will always return same output.
PHP Code:
$data $this->upload->data();
if(
$this->image_lib->resize()) {
    
$data['file_name'] = $data['raw_name']."_thumb.".$data['file_ext'];
}
return 
$data
Reply
#3

Thanks for the help Wink
Reply




Theme © iAndrew 2016 - Forum software by © MyBB