我正在尝试从我的画布上创建一个图像,但经过一些尝试后,我似乎无法在后端获得一个有效的上传 PNG。有人可以看看这里发生了什么吗?
我的JavaScript:
stage.toDataURL({
callback: function(dataUrl) {
var imgURL = dataUrl; // keep the entire url
$.ajax({
type: "POST",
url: "http://www.xxxx.nl/pointer/upload.php",
data: ({imgData : imgURL}),
cache: false,
success: function(result){
//window.open(dataUrl); // Show result stage in a new window
alert(result); // show php error if exists
}
});
}
});
我现在非常基本的.php:
$im = imagecreatefrompng($_POST['imgData']);
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
我的错误日志:
[Fri Mar 08 11:29:16 2013] [error] [client 24.132.214.139] mod_security: Access denied with code 500. Error reading request body, error code 70007: The timeout specified has expired [hostname "www.ccc.nl"] [uri "/pointer/upload.php"]