PHP照片格式不正确

时间:2014-08-18 05:14:27

标签: php http http-post

我正在尝试使用PHP HTTP Post上传照片,但我收到以下错误:

警告:imagecreatefromstring():gd-jpeg:JPEG库报告不可恢复的错误:在 / home / randomma / public_html / RandomMash / Web Service / Main.php 205
警告:imagecreatefromstring(): / home / randomma / public_html / RandomMash / Web Service / Main.php 行上传递的数据不是'JPEG'格式205

警告:imagecreatefromstring():无法在 / home / randomma / public_html / RandomMash / Web Service / Main.php 行中创建GD图像​​流> 205

警告:imagejpeg()期望参数1为资源,布尔值 / home / randomma / public_html / RandomMash / Web Service / Main.php 在线 205

以下是我用来尝试保存文件的代码:

imagejpeg(imagecreatefromstring(base64_decode($_POST["img"], TRUE)), "/Users/Images/20/".md5(uniqid()).".png");

0 个答案:

没有答案