语言

Menu
Sites
Language
Delete image file

I'm trying to delete an image file with this code:

tizen.filesystem.resolve(
               'file://' + path, 
               function(dir){
                 console.log('delete: ' + dir);
                 dir.deleteFile(
                         'file://' + filename,
                         function(){
                           console.log("File Deleted");
                         }, function(e) {
                           console.log("Error delete file: " + e.message);
                         });
               }, function(e){
                 console.log("Error" + e.message);
               }, "rw"
             );

File is succesfully deleted. But when I open a standart gallery app from my program, deleted file is still available (it is counted, but no preview image). If I restart emulator than everything is fine (file not counted in gallery app and all preview are ok).

How can I refresh image list for gallery app from my programm?

响应

4 回复
Raghu Kona

Hi,

I observed the same behavior on my device. After a quick search, I found a similar bug raised in Jira.

I have added comments referring to ur post. Please follow for updates.

Regards,

Raghu Kona

Raghu Kona
Alexander AVSukhov

Hello,

Along the platform tean policy, if you want to save/delete under media folder, you must update media db.
You need to call scanFile of content manager class from Content api to update content in media DB.
The documents can be found with following step:

Tizen Web App Programming > API References > Device API Reference > Content > Content API
Tizen Web App Programming > Programming Guide > Device Guides > Content Guides > Content: Managing Multimedia

Maxim Smolyaninov

Alexander, thanks, this solve the problem.