Ok, of course, you cannot delete a file (media or non-media file) that is not created by the app itself on Android 11+. And also you cannot accesss media files on any Android version that is not created by the app without READ permission (on any Android version, as I already told you).
So you need SAF to delete a (media) file on Android 11+ (if the file is not created by the app).
I have simplified the TESTICON .aia as much as possible and will send it to you. I also have a recording that I would like to send you of the download and deletion operation. How do I send it to you? TESTICON.aia (9.8 KB)
If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...
which means in your case post a screenshot of your relevant blocks...
To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.
I got the test aia project to work OK once I had added a second activityStarter, so one for opening the website, and one for deleting a file. This downloaded a file, and i was then able to delete that file.
The disadvantage of this method is that it does not necessarily open the correct directory (but the last one opened). Therefore, I would generally prefer the SAF method.
I tried your suggestion. Accessing Downloads works and I get a list of png files, but this list is disabled.
You also say that I have to give read permissions, I tried with SAF, but what do you mean?