开发者

CodeIgniter uploads files with duplicate file extensions

开发者 https://www.devze.com 2023-02-07 16:04 出处:网络
Any obvious reasons why CodeIgniter would duplicate th开发者_运维百科e file extension when using its Upload library? Tried all sort of ways to set the file name (with and without extension) and nothin

Any obvious reasons why CodeIgniter would duplicate th开发者_运维百科e file extension when using its Upload library? Tried all sort of ways to set the file name (with and without extension) and nothing seem to work. Any tips?


I've encountered this same issue previously (unsure why, as it certainly doesn't occur in all my projects). The following fixed it for me (where $file_name is name of file):

$ext = end(explode('.',$file_name)); 
$config['file_name'] = basename($file_name,'.'.$ext);
0

精彩评论

暂无评论...
验证码 换一张
取 消