CodeIgniter Upload image and then resize it

☆樱花仙子☆ 提交于 2019-12-03 15:02:26

Did you tried to add this to the config options

$config['overwrite'] = TRUE;

This should do the trick.

According to the documentation

If set to true, if a file with the same name as the one you are uploading exists, it will be overwritten. If set to false, a number will be appended to the filename if another with the>same name exists.

i have been trying to create thumbnails for the past 20 hrs and i was not successful until i realized where i was messing up with the code, i was not INITIALIZING my config array!!!

Just add this line of code after loading your image_lib

$this->image_lib->initialize($config);

Hope this works for you...........thumbs up!

If you like to play with Image with CI, I highly recommend , image_moo library.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!