Deleting files

Options
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.

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     not yet but that is something we are actively working on so it will be coming soon. 
  • Jarryd Christensen
    Options
    Thanks. Do you have an idea of timeline?
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     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. 
  • Abdulrahman Hariri
    Options
     Would you be able to tell if certain file(s) are not used before purging?
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     how are you defining a file not in use in this example?
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Also - we have since introduced File management - so you can delete your files without needing to contact support
  • Sönke Manaré
    Options
    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?
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     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. 
  • Sönke Manaré
    Options
      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. 
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     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
  • GeraldoNeves
    Options

    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.