How to delete a file in the internal storage

Hi! I would like to know how to delete a photo that is in Internal Storage.

So this is the blocks to save the edited picture:

This is the file I want to delete:

And this is the blocks to delete the file :
blocks(1)

But as you guessed it doesn’t work! Please help me!

let me suggest you to store the image in ASD rather than in the root directory of the emulated sdcard
from there is should be easy to delete again…
also make sure to use the correct path… file:///storage/emulated/0/...
see also Some basics on Android storage system

Taifun

Ok but how to store the image in ASD with the Image Editor component ? I’ve tried a lot of times to save on a different directory but each time it doesn’t work.

Use the correct path… my file extension offers a method for that…

Taifun

I dont understand how store the image in ASD with the Image Editor component with your extension

Path of root is /storage/emulated/0/

Still doesn’t work when i use /storage/emulated/0/[global file_name]

Can you share your app here

Sure this is tha aia file :
tiktik(2).aia (129.5 KB)

Also, I have another problem with some devices that downloads the app, they can’t accept the WRITE_STORAGE and READ_STORAGE permission (they can’t accept from the app settings menu and when I use the block “ask for permission”)

yes, these permissions never existed and WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE do not exist anymore for devices Android 11+

Taifun

A small correction: WRITE_EXTERNAL_STORAGE does no longer exist on Android 11+ and READ_EXTERNAL_STORAGE does no longer exist on Android 13+.

[quote=“ForRob, post:1, topic:247026”]
And this is the blocks to delete the file :
blocks(1)

The File component uses a relative path.

You cannot delete a file in the root dir of the external storage on Android 11+ (without all-file-permission, which is not allowed by Google in the Play Store).

Ok so how to store the edited pictures on a specific folder and then delete it ?

Now we are again at rhe beginning of this thread

Taifun

Ok but why is there an error The permission WRITE_EXTERNAL_STORAGE is denied on some devices when I just want to pick an image with the"Image_Picker" component.

Some this explanation

In the same thread you can find a workaround

Taifun

So as I’ve read in this topic :

I’ve tried to store the picture in the ASD using this path :

 /storage/emulated/0/Android/data/<packageName>/files/

But it still doesn’t work and the Image Editor is not returning any image

Very good
Now if you use the ApplicationSpecificDirectory method from the tools extension, you get that path dynamically, which will work for the companion app and after building any app

Taifun

Do I have to do this ? I don’t understand

It stillk doesn’t work

Now use Do it to check the filename…

Most probably a slash is missing…

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps

see also Live Development, Testing and Debugging

Taifun

So this is what I get :

I added a slash and this is what I get :

On the companion when I try to set the vertical arrangement image to the edited image it doesn’t show anything :

And in the Internal Storage the image is not here anymore (btw I don’t now how to find the image and i don’t know if it’s findable)

Sorry for the delay I wasn’t home for 4 days :sweat_smile: