Error with Files.remove API

Am getting “File or directory cannot be found” error when I try to use the Backendless.Files.remove API. I copied the URL link and verified that I got the address right.

To reproduce the issue we’d need to know the following:

  1. URL of the file you’re trying to delete.
  2. Your application ID.

Regards,
Mark

APPLICATION_ID = “C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00”;

URL:
https://backendlessappcontent.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/E4789484-504E-439B-95D1-3FD5717C4947/files/Animal/ANZJSDpFPHB_0

Hello @Nkekere_Tommy_Minimann

Try this:

Backendless.Files.remove( "Animal/ANZJSDpFPHB_0" );

Deleting a File

Can I remove a file based on the date created?

Hello @Nkekere_Tommy_Minimann

No, but you can listen to directories/files, then create a list of dirs/files to remove and finally remove all of them one by one

https://backendless.com/docs/js/file_directory_listing.html

Regards, Vlad