第一步:查看一下你的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,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 (" } else {
return (" }
}
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..)的解决办法全部内容,希望文章能够帮你解决织梦dedecms系统图片集上传时提示错误信息“(FILEID:1|2|3..)的解决办法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)