欢迎来到素材无忧网,按 + 收藏我们
登录 注册 退出 找回密码

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

时间: 2018-11-27 12:02 阅读: 作者:素材无忧网

网上看到很多朋友遇到使用织梦程序一段时间后,发现上传图集时候老是失败,提示FILEID:X错误,缩略图显示为红色Error下面截图错误:
dede织梦图片集上传时提示错误信息“(FILEID:1|2|3..)的解决(图1)

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

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

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

代码如下:

  1. <?php
  2. //remove the utf-8 boms
  3. //by magicbug at gmail dot com
  4. if (isset($_GET['dir'])){ //config the basedir
  5. $basedir=$_GET['dir'];
  6. }else{
  7. $basedir = '.';
  8. }
  9. $auto = 1;
  10. checkdir($basedir);
  11. function checkdir($basedir){
  12. if ($dh = opendir($basedir)) {
  13.   while (($file = readdir($dh)) !== false) {
  14.    if ($file != '.' && $file != '..'){
  15.     if (!is_dir($basedir."/".$file)) {
  16.      echo "filename: $basedir/$file ";
  17.      echo checkBOM("$basedir/$file")." <br>";
  18.     }else{
  19.      $dirname = $basedir."/".$file;
  20.      checkdir($dirname);
  21.     }
  22.    }
  23.   }
  24. closedir($dh);
  25. }
  26. }
  27. function checkBOM ($filename) {
  28. global $auto;
  29. $contents = file_get_contents($filename);
  30. $charset[1] = substr($contents, 0, 1);
  31. $charset[2] = substr($contents, 1, 1);
  32. $charset[3] = substr($contents, 2, 1);
  33. if (ord($charset[1]) == 239 && ord($charset[2]) == 187 && ord($charset[3]) == 191) {
  34.   if ($auto == 1) {
  35.    $rest = substr($contents, 3);
  36.    rewrite ($filename, $rest);
  37.    return ("<font color=red>BOM found, automatically removed.</font>");
  38.   } else {
  39.    return ("<font color=red>BOM found.</font>");
  40.   }
  41. }
  42. else return ("BOM Not Found.");
  43. }
  44. function rewrite ($filename, $data) {
  45. $filenum = fopen($filename, "w");
  46. flock($filenum, LOCK_EX);
  47. fwrite($filenum, $data);
  48. fclose($filenum);
  49. }
  50. ?>

将代码另存为.php,放在网站根目录下运行该文件就可以了。

运行完毕后刷新后台,上传图片,就成功了!

运行后记得更新下缓存:
dede织梦图片集上传时提示错误信息“(FILEID:1|2|3..)的解决(图2)

版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!

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

标签:  
模板推荐