我正在尝试使用它的 public_id 替换 cloudinary 上的图像。因此,我使用时间戳、public_id 和覆盖进行了签名。我已将覆盖值设置为“真”。下面我附上了正在传递的参数的屏幕截图。图片已成功上传,但版本标签不同,但未替换原始图片。
奇怪的是,更改后的图像在第一次上传时成功替换了原始图像,但不适用于该图像的任何进一步上传。因此,上传成功,但使用不同的版本标签上传。
http://cloudinary.com/documentation/upload_images#renaming_images 我已经使用上面链接中给出的覆盖选项来替换原始图像。
我等了很长一段时间(至少半小时),以为变化可能需要时间来反映,但它保持不变。
对这里可能有什么问题有任何见解吗?
var newForm = new FormData();
newForm.append('timestamp',ts);
newForm.append('api_key', $rootScope.CLOUDINARY_CONFIG.api_key);
newForm.append('signature', signature);
newForm.append('public_id', scope.model.public_id);
newForm.append('overwrite', true);
newForm.append('file', canvasImage);
$http.post($rootScope.CLOUDINARY_CONFIG.upload_url, newForm, {
transformRequest: angular.identity,
file : canvasImage,
headers: {'X-Requested-With': 'XMLHttpRequest','Content-Type': undefined}
})
.success(function(data){
// success
})
.error(function(err){
// log error
console.log('fail');
});