【发布时间】:2014-04-18 21:00:52
【问题描述】:
所以我正在使用 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 文件中做什么?
【问题讨论】:
-
尝试回显
$image_data。你得到了什么? -
我从来没有真正看到过处理 php 的页面。它有点像
ajax所以即使我回显$image_data我什么也看不到。
标签: php codeigniter aviary