欢迎光临! 【模板119】平台每天更新源码-所有VIP源码均有在线演示

logo

建站一条龙服务

dede织梦图片集上传时提示错误信息“(FILEID:1|2|3..)的解决方法

织梦源码推荐

dede织梦图片集上传时提示错误信息“(FILEID:1|2|3..)的解决方法

这问题今天也让我头疼了半天,好好的怎么就出现这问题了,我最近好像没修改过啥文件了,最后找资料整理出了解决办法,分享给遇到该问题的朋友:分两步:

第一步:查看一下你的include/common.inc.php 的文件格式UTF-8编码的朋友,注意将格式调整为UTF-8 无BOM格式,GBK编码的朋友,注意将格式调整为ANSI(使用NotePad++,菜单栏有一格式菜单,打开即可调整文件格式,当然也可以选择DW,Editeplus 云云)

第二步:给大家提供一个缩略图修复文件,保存为a.php,放在网站根目录访问下就可以了。

代码(红色部分)如下:

//remove the utf-8 boms
//by magicbug at gmail dot com
if (isset($_GET['dir'])){ //config the basedir
$basedir=$_GET['dir'];
}else{
$basedir = '.';
}
$auto = 1;
checkdir($basedir);
function checkdir($basedir){
if ($dh = opendir($basedir)) {
  while (($file = readdir($dh)) !== false) {
   if ($file != '.' && $file != '..'){
    if (!is_dir($basedir."/".$file)) {
     echo "filename: $basedir/$file ";
     echo checkBOM("$basedir/$file")."
";
    }else{
     $dirname = $basedir."/".$file;
     checkdir($dirname);
    }
   }
  }
closedir($dh);
}
}
function checkBOM ($filename) {
global $auto;
$contents = file_get_contents($filename);
$charset[1] = substr($contents, 0, 1);
$charset[2] = substr($contents, 1, 1);
$charset[3] = substr($contents, 2, 1);
if (ord($charset[1]) == 239 && ord($charset[2]) == 187 && ord($charset[3]) == 191) {
  if ($auto == 1) {
   $rest = substr($contents, 3);
   rewrite ($filename, $rest);
   return ("BOM found, automatically removed.");
  } else {
   return ("BOM found.");
  }
}
else return ("BOM Not Found.");
}
function rewrite ($filename, $data) {
$filenum = fopen($filename, "w");
flock($filenum, LOCK_EX);
fwrite($filenum, $data);
fclose($filenum);
}
?>
将代码另存为.php,放在网站根目录下运行该文件就可以了。
运行完毕后刷新后台,上传图片,就成功了!

运行后记得更新下缓存

dede织梦图片集上传时提示错误信息“(FILEID:1|2|3..)的解决方法

二维码

本文手机访问二维码

作者:mb119.com        关注度:47        发布时间:2016-06-30 04:56:53
首先声明,只要是我们的vip会员所有源码均可以免费下载,不做任何限制
☉本站的源码不会像其它下载站一样植入大量的广告。
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ(971977809)进行交流点击这里给我发消息
相关故障问题内容
在线客服