帝国CMS 上传附件维持原文件名的方法!
发布时间:2022-04-14 10:38:18 所属栏目:建站 来源:互联网
导读:帝国CMS 上传附件保持原文件名 找到 /e/class/connect.php 查找 $r[filetype]=GetFiletype($file_name); 在下面加入 $filename2=str_replace($r[filetype], , $file_name); //获得去掉后缀的文件名 $mytype = array (.cod, .jad); //定义需要保留原名的文件
帝国CMS 上传附件保持原文件名 找到 /e/class/connect.php 查找 $r[filetype]=GetFiletype($file_name); 在下面加入 $filename2=str_replace($r[filetype], '', $file_name); //获得去掉后缀的文件名 $mytype = array (".cod", ".jad"); //定义需要保留原名的文件类型 查找 $r[filename]=$r[insertfile].$r[filetype]; 修改为 if(in_array($r[filetype],$mytype)){ $r[filename]=$filename2.$r[filetype]; //真实文件名 } else { $r[filename]=$r[insertfile].$r[filetype]; (编辑:宿州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐