易仿帝国yfdiguo.com

您当前的位置:首页 > 问题库

帝国CMS上传附件保持原文件名的方法

zcmcss发表于2017-12-11问题库
打开 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];
}

热门问题

©2017 易仿帝国yfdiguo.com


友情链接: 阿里云优惠网| 阿里云推荐码| 阿里云教程| 莫愁博客|
♥ www.yfdiguo.com
联系作者QQ: