doucanrui1735 2014-06-13 05:56
浏览 10

PHP Google App Engine从云存储中永久删除图像

I'm using GAE version 1.9.0 and I want to delete an image from the data storage and upload another image to its location. This is how I'm doing it right now.

unlink("gs://my_storage/images/test.jpg");
move_uploaded_file($_FILES['image']['tmp_name'],'gs://my_storage/images/test.jpg');

And then I want to get the Image serving URL of the latest uploaded image, and I do it like this.

$image_link = CloudStorageTools::getImageServingUrl("gs://my_storage/images/test.jpg");

The issue is, when the name of the deleted image("test.jpg") and the uploaded image("test.jpg") is the same, the old file is served when I call for the newly uploaded file(I think it is cached.)

Is there anyway I can permanently delete this file without caching it?

  • 写回答

1条回答 默认 最新

  • dongpeiwei8589 2014-06-13 16:35
    关注

    You should probably delete the original serving URL before creating another with the same name.

    There's a deleteImageServingUrl() method in CloudStorageTools that you can use to do this.

    评论

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错