网上看到很多朋友遇到使用织梦程序一段时间后,发现上传图集时候老是失败,提示“提示FILEID:X错误,缩略图显示为红色Error“下面截图错误:

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

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

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

代码(红色部分)如下:

<?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")." <br>";
    }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 ("<font color=red>BOM found, automatically removed.</font>");
  } else {
   return ("<font color=red>BOM found.</font>");
  }
}
else return ("BOM Not Found.");
}
function rewrite ($filename, $data) {
$filenum = fopen($filename, "w");
flock($filenum, LOCK_EX);
fwrite($filenum, $data);
fclose($filenum);
}
?>
将代码另存为.php,放在网站根目录下运行该文件就可以了。
运行完毕后刷新后台,上传图片,就成功了!

运行后记得更新下缓存

最新文章

  1. oracle中SQL根据生日日期查询年龄的方法
  2. Keil C51中变量的使用
  3. regular expression 基本语法
  4. 14.4.3.6 Fine-tuning InnoDB Buffer Pool Flushing 微调 InnoDB Buffer Pool 刷新:
  5. iOS TextField输入框点击键盘时随着键盘上移
  6. js 日期大小比较
  7. hibernate-第一章-基础
  8. python 2 和 python 3 的区别
  9. SQL语句(floor、ceiling和round以及left和right)
  10. 3ds max学习笔记(十四)-- (FFD自由变形)
  11. Codeforces Round #516 (Div. 2, by Moscow Team Olympiad) D. Labyrinth
  12. Windows2008R2系统运行时间超过497天的bug
  13. http://www.bugku.com:Bugku——Easy_vb
  14. excel2007VBA绘图2
  15. python BitTornado P2P分发大文件
  16. Spring Boot动态修改日志级别
  17. Python3 abs() 函数
  18. Thrift编译错误('::malloc' has not been declared)
  19. Synchronizer解析(为AQS打个铺垫)
  20. centos65安装docker遇到的问题

热门文章

  1. DotNetBar 第1课,设置整体窗口样式
  2. esrdtfyghjk
  3. nexus私服update repair index索引失败解决方案(转)
  4. coreData部分报错:This NSPersistentStoreCoordinator has no persistent stores.
  5. Cantor的数表
  6. 吴奇隆刘诗诗婚礼场地:巴厘岛Ayana酒店,美到窒息!
  7. 一次 surface pro 3 的售后保修 黑色三月维权(HSD)
  8. div隐藏与显示
  9. libgcc_s.so.1 must be installed for pthread_cancel to work
  10. java序列化知识整理