dedecms 图片集上传时提示错误信息“(FILEID:1|2|3..)“的解决
网上看到很多朋友遇到使用织梦程序一段时间后,发现上传图集时候老是失败,提示“提示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..)“的解决的更多相关文章
- 文件上传时出现 Processing of multipart/form-data request failed. Unexpected EOF read on the socket错误
上传时一直出现这个错误,修改tomcat的server.xml文件,更改tomcat版本,也查阅了网上的很多解决办法,都不能解决问题. 后在stackoverflow的一篇文章上找到了解决方法: 加上 ...
- 解决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 ...
- Koa - 使用koa-multer上传文件(上传限制、错误处理)
前言 上传文件在开发中是很常见的操作,今天我选择使用koa-multer中间件来实现这一功能,除了上传文件外,我还会对文件上传进行限制,以及发生上传错误时的处理. 由于原来的 koa-multer 已 ...
- 【原创】用JAVA实现大文件上传及显示进度信息
用JAVA实现大文件上传及显示进度信息 ---解析HTTP MultiPart协议 (本文提供全部源码下载,请访问 https://github.com/grayprince/UploadBigFil ...
- 在Ubuntu 12.04 - 64bit中安装CodeSourcery时提示错误
安装时提示错误,Your 64-bit Linux host is missing the 32-bit libraries requied to install and use Sourcery C ...
- github上传时出现error: src refspec master does not match any解决办法
github上传时出现error: src refspec master does not match any解决办法 这个问题,我之前也遇到过,这次又遇到了只是时间间隔比较长了,为了防止以后再遇到类 ...
- webAPI 上传文件 404错误(转载)
webAPI文件上传时文件过大404错误的问题 来源:https://www.cnblogs.com/dzhengyang/p/9149157.html 背景:最近公司有个需求,外网希望自动保存数据 ...
- 用JAVA实现大文件上传及显示进度信息
一. 大文件上传基础描述: 各种WEB框架中,对于浏览器上传文件的请求,都有自己的处理对象负责对Http MultiPart协议内容进行解析,并供开发人员调用请求的表单内容. 比如: Spring 框 ...
- 解决使用elementUI框架el-upload跨域上传时session丢失问题
解决方法一: 1.使用elementUI框架el-upload跨域上传时,后端获取不到cookie,后端接口显示未登录,在添加了 with-credentials="true"后依 ...
随机推荐
- wordpress视频教程
wordpress还不错的一套自动赚钱视频教程 http://www.ggfenxiang8.com/?p=256
- pdf转成图片
http://blog.csdn.net/wydhao123/article/details/51596028 jar commons-logging.jar. pdfbox-2.0.1.jar.fo ...
- ion-refresher 下拉更新数据
使用指令ion-refresher可以为容器eg:ion-scroll 和 ion-content进行拉动刷新 <ion-scroll> <ion-refresher on-refr ...
- 条件随机场(CRF) - 2 - 定义和形式(转载)
转载自:http://www.68idc.cn/help/jiabenmake/qita/20160530618218.html 参考书本: <2012.李航.统计学习方法.pdf> 书上 ...
- POJ 1101 简单BFS+题意
The Game 题意: Description One morning, you wake up and think: "I am such a good programmer. Why ...
- thinkphp基于角色的权限控制详解
一.什么是RBAC 基于角色的访问控制(Role-Based Access Control)作为传统访问控制(自主访问,强制访问)的有前景的代替受到广泛的关注. 在RBAC中,权限与角色相关联,用户通 ...
- oracle-trasnlate函数
1.translate函数语法 TRANSLATE(string,from_str,to_str) 2.作用有两个: 1)可以替换string中的对应字符,from_str和to_str会做字符的一一 ...
- MapReduce job.setNumReduceTasks(0)思考
一.概述 在 http://zy19982004.iteye.com/blog/2037549的最后曾经提到过,这里再详细探讨一下. 二.job.setNumReduceTasks(0)唯一影响的是m ...
- [BCB] C++ Builder 绘图 绘制直线 —— 基于像素
大三的这前半个学期了,又遇上了这个精通(滑稽) Delphi的老师,人还挺好的其实. 关于他对分辨率的吐槽呀,对Delphi的赞美啊,都是非常幽默的.另外我倒是很欣赏他对他的笔记本的保养[dell i ...
- json loads No JSON object could be decoded 问题解决
今天自己用json的 dumps生成的 json 文本: f2=open(filename,'w')f2.write(json.dumps(c) f=open(filename,'r')r= f.re ...