所以我正在使用Aviary来编辑我的图片,我有这个运行应用程序的脚本。
<script type='text/javascript'>
var featherEditor = new Aviary.Feather({
apiKey: '',
apiVersion: 3,
theme: 'light', // Check out our new 'light' and 'dark' themes!
tools: 'all',
appendTo: '',
onSave: function (imageID, newURL) {
},
postUrl: 'http://beta.usd309bands.org/upload/saveEditiedImage/',
onError: function (errorObj) {
alert(errorObj.message);
}
});
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
</script>然后我的php代码将现有的图片替换为编辑后的图片,代码如下:
$image_data = file_get_contents($_REQUEST['url']);
file_put_contents("static/images/gallery/image1.jpg",$image_data);此脚本与现有文件建立联系并覆盖它。但它会将其覆盖为空。只是一个空的image1.jpg文件。
我在这里做错了什么?我还需要在php文件中做些什么?
发布于 2014-04-19 05:16:52
好的,所以我在php文件中的所有东西都是完全正确的,并且工作正常。发生问题的地方超出了我自己的编码范围。
服务器有两个php配置,必须满足这两个配置才能处理此操作。
allow_url_fopen MUST BE EQUAL TO 1
allow_url_fopen='1'; // My Values 和
post_max_size MUST BE GREATER THAN THE IMAGE YOU ARE SAVING
post_max_size ='120M'; // My Valueshttps://stackoverflow.com/questions/23162262
复制相似问题