Deleting files
Options
![Jarryd Christensen](https://us.v-cdn.net/6037124/user_avatars/3590738.jpg)
Jarryd Christensen
Member ✭
Is there a way to delete files that have been uploaded to storage? When uploading a new image to a record it's replacing the metadata but don't know what happens to the previous file. Don't want to fill up the storage with old files.
I will probably create a table purely for saving the file metadata and then saving the corresponding ID for that file in other tables so that I can have a record of the files saved somewhere if there's no way to query the storage.
I will probably create a table purely for saving the file metadata and then saving the corresponding ID for that file in other tables so that I can have a record of the files saved somewhere if there's no way to query the storage.
Comments
-
not yet but that is something we are actively working on so it will be coming soon.
-
Thanks. Do you have an idea of timeline?
-
not yet - in the meantime, if your media storage becomes maxed out as a result just contact support and we can clear it manually for you.
-
Would you be able to tell if certain file(s) are not used before purging?
-
how are you defining a file not in use in this example?
-
Also - we have since introduced File management - so you can delete your files without needing to contact support
-
-
Hi just discorvered the file management browser which helps a lot! Still I am wondering if it is possible to delete files via API / Business Logic?
As an example:
• I am storing a record with linked pdf documents
• If a user deletes this record via endpoint, I want to auto-delete the corresponding files in the storage. Otherwise storage will be wasted with unused files
• Unused means in this case: Not linked by any database record
Is there a way to do that? -
there is not a way to do that via the API/Business logic. One thing you could do is create a table of "deleted_files" which adds the file or filename to a table each time the user deletes one via the API. Then when you go into the file management section you know which could be removed.
-
thanks for the great tip, I’ll do it exactly that way.
For the future can you say if the feature “Delete files via API” is on your roadmap? It would really save a lot of time and effort to do this automatically. -
I anticipate that improving file management is in the pipeline! We just launch v1 a couple months ago (previously you couldn't even manage files manually) but there is definitely room for improvement
-
It's almost unbelievable that we can't delete files from storage via API. a problem so big that it makes me doubt whether to use Xano as a Professional Backend...
I see the discussion here starting in August 2022.
In other words, more than 1 year ago. Can you tell me if this already has a solution?
Is it now possible to delete files from storage via API?
Thanks.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback