简体   繁体   English

IONIC从图库中删除图片

[英]IONIC delete image from gallery

I am using cordova file plugin to delete image from gallery. 我正在使用cordova文件插件从图库中删除图像。 here is the code 这是代码

 window.resolveLocalFileSystemURL(path+filename, function (result) {
     result.remove(function(data){
            console.log(data)
      });
 });

As per above code I am getting success return and file is also deleted from folder. 按照上面的代码,我得到成功返回,并且文件也从文件夹中删除。 But When I am going to the gallery it is showing me a blank thumbnail. 但是当我去画廊时,它向我显示了一个空白缩略图。 When I am trying to open this file it is showing only grey color. 当我尝试打开此文件时,它仅显示灰色。 In details it is showing the old path. 详细地,它显示了旧的路径。 But in that path file does not exists. 但是在该路径文件中不存在。 I think this is a kind of cache. 我认为这是一种缓存。 How can I delete that blank file? 如何删除该空白文件?

我的代码还可以,我只需要使用Media Scanner扫描图库即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM