To list/filter files:
https://bubble.io/appeditor/list_uploaded_files
{
"cursor": 0,
"limit": 100,
"filename": "",
"only_private_file": false,
"file_type": "all",
"sort_type": "date",
"descending": true,
"appname": "{appID}",
"app_version": "{version}"
}
To delete file(s):
https://bubble.io/appeditor/delete_uploaded_files
{
"appname": "{appID}",
"app_version": "{version}",
"urls_to_delete": ["{fileS3Key}"]
}
{fileS3Key} is returned from the list files endpoint.
Both of these require you to be authenticated with the login cookie of a collaborator on the app that has permission to access the file data on that version.
It just means that in theory, if you have a list of file URLs from your database, you can actually manage to delete orphaned files by deleting any files that aren’t stored in the DB. Of course, Bubble won’t allow you to do that yourself in the editor (and wouldn’t endorse this method either). However, all this is, is a way to automate what you can already do in the editor (and, for example, get 1000s of files at a time rather than 50…) if you have sufficient coding experience or can be bothered enough.
2 Likes