网上看到很多朋友遇到使用织梦程序一段时间后,发现上传图集时候老是失败,提示“提示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,放在网站根目录下运行该文件就可以了。
运行完毕后刷新后台,上传图片,就成功了!

运行后记得更新下缓存

dedecms 图片集上传时提示错误信息“(FILEID:1|2|3..)“的解决的更多相关文章

  1. 文件上传时出现 Processing of multipart/form-data request failed. Unexpected EOF read on the socket错误

    上传时一直出现这个错误,修改tomcat的server.xml文件,更改tomcat版本,也查阅了网上的很多解决办法,都不能解决问题. 后在stackoverflow的一篇文章上找到了解决方法: 加上 ...

  2. 解决SVN Cleanup时遇到错误信息:Cleanup failed to process the following paths:xxxxxxx Previous operation has not finished: run 'cleanup' if it was interrupted Please execute the 'Cleanup' command.

    解决SVN Cleanup时遇到错误信息:Cleanup failed to process the following paths:xxxxxxx Previous operation has no ...

  3. Koa - 使用koa-multer上传文件(上传限制、错误处理)

    前言 上传文件在开发中是很常见的操作,今天我选择使用koa-multer中间件来实现这一功能,除了上传文件外,我还会对文件上传进行限制,以及发生上传错误时的处理. 由于原来的 koa-multer 已 ...

  4. 【原创】用JAVA实现大文件上传及显示进度信息

    用JAVA实现大文件上传及显示进度信息 ---解析HTTP MultiPart协议 (本文提供全部源码下载,请访问 https://github.com/grayprince/UploadBigFil ...

  5. 在Ubuntu 12.04 - 64bit中安装CodeSourcery时提示错误

    安装时提示错误,Your 64-bit Linux host is missing the 32-bit libraries requied to install and use Sourcery C ...

  6. github上传时出现error: src refspec master does not match any解决办法

    github上传时出现error: src refspec master does not match any解决办法 这个问题,我之前也遇到过,这次又遇到了只是时间间隔比较长了,为了防止以后再遇到类 ...

  7. webAPI 上传文件 404错误(转载)

    webAPI文件上传时文件过大404错误的问题  来源:https://www.cnblogs.com/dzhengyang/p/9149157.html 背景:最近公司有个需求,外网希望自动保存数据 ...

  8. 用JAVA实现大文件上传及显示进度信息

    一. 大文件上传基础描述: 各种WEB框架中,对于浏览器上传文件的请求,都有自己的处理对象负责对Http MultiPart协议内容进行解析,并供开发人员调用请求的表单内容. 比如: Spring 框 ...

  9. 解决使用elementUI框架el-upload跨域上传时session丢失问题

    解决方法一: 1.使用elementUI框架el-upload跨域上传时,后端获取不到cookie,后端接口显示未登录,在添加了 with-credentials="true"后依 ...

随机推荐

  1. Mark Down绘图语法

    以下语法在网易云笔记中测试通过. 绘图的标志位是三个单引号```  开始  ``` 结尾 ,注意是英文半角的单引号,以下的字符也是英文半角状态下的才正确. 搜狗输入法的要特别注意,记得把shift 切 ...

  2. A Look At Android Support Annotations

    转自:https://asce1885.gitbooks.io/android-rd-senior-advanced/content/shen_ru_qian_chu_android_support_ ...

  3. DEDECMS 留言薄模块的使用方法

    一.留言薄的安装 留言薄的安装过程和其他插件一样,首先我们进入后台模块管理列表,点击其对应的“安装”: 以上步骤,我们完成了留言薄插件的安装. 二.留言薄的卸载 留言薄的卸载,同样首先我们要进入模块管 ...

  4. with as的用法

    ;with T1 as ( select FTP_ID,FTP_NAME,FTP_Server,FTP_Port,FTP_UserID,FTP_Password from FTP_Config wit ...

  5. 用php脚本给html中引用的js和css路径打上版本

    比如 <link rel="stylesheet" type="text/css" href="./css/globel.css"&g ...

  6. Install Debian note

    environment: already install xp,win7 and win8PE, left 87G space to install Debian, this space not fo ...

  7. Apache+PHP+MySQL

    Apache:是一种web服务器(与IIS类同)PHP:全称为Hypertext Preprocessor.PHP是一种HTML 内嵌式的语言,是一种网站(网页)开发语言(与ASP.JSP..NET等 ...

  8. 解决Type 'UnityEngine.Component' does not support slicing

    unity从4.x升级到5.x后部分脚本的编译错误 将animation改成GetComponent.<Animation>()

  9. 初识linux端c++程序开发

    关于linux端程序开发,我以前一直不知道是做些什么,只是感觉听高端的.最近接触了一些,有了一些初步的认识. 首先,linux是一个操作系统,跟windows一样:接通电源.按下电脑开机,电脑就会自动 ...

  10. Windows环境下npm install常见错误

    Windows环境下npm install安装包依赖时,常出现一些错误,下面为个人解决办法: 错误一 缺少python环境: G:\nodejs\moviesite\node_modules\bcry ...