您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP GD 库无法处理 post 上传的图片

2024/5/23 17:21:45发布25次查看
代码如图:


运行环境:win64-apache2.4.9-php5.5.12
ubuntu64-apache2.4.7-php5.5.9
我百度/google 查了很多,可以确定:gd库已经开启(成功处理验证码并输出)
文件夹权限正常(读写文件成功)
尝试过这些:直接输出上传的文件,失败



读取服务端文件并输出,成功

重命名上传的文件并输出,失败
0,'y'=>0,'w'=>288,'h'=>402);// setpicture($target, $source, $position_target, $position_source);// header(content-type: image/png; charset=utf-8);// header(content-type: image/png;);// imagepng($target); // imagedestroy($target); // $target=imagecreatefrompng($_files['test']['tmp_name']);// var_dump($_files);

回复内容: 代码如图:


运行环境:win64-apache2.4.9-php5.5.12
ubuntu64-apache2.4.7-php5.5.9
我百度/google 查了很多,可以确定:gd库已经开启(成功处理验证码并输出)
文件夹权限正常(读写文件成功)
尝试过这些:直接输出上传的文件,失败



读取服务端文件并输出,成功

重命名上传的文件并输出,失败
0,'y'=>0,'w'=>288,'h'=>402);// setpicture($target, $source, $position_target, $position_source);// header(content-type: image/png; charset=utf-8);// header(content-type: image/png;);// imagepng($target); // imagedestroy($target); // $target=imagecreatefrompng($_files['test']['tmp_name']);// var_dump($_files);

问题基本就是$_files的路径和绝对路径有区别,建议你可以把$_files打印出来看看
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product