Can't delete file from code in ios

i am trying to delete a file with code in iOS but for some reason i have a problem with this.

i use


print(messageToPass.file!.fileURL!)


let fileURL = messageToPass.file?.fileURL

            backendless.fileService.remove(fileURL!, response: { (respone) in

                print(respone)

                }, error: { (error) in

                    print(error)

            })



but have an error
FAULT = ‘6000’ [File or directory cannot be found.] <File or directory cannot be found.>
despite that before delete method i have a proper fileURL (https://api.backendless.com/b98036d8-4c4b-8d51-ff42-e6c0e74cf800/v1/files/image1458248856.94247.jpg)

Must be a problem with directory mounting. Let us check.

What value do you use for fileURL? Is it the complete URL of the file? Just like this?:
https://api.backendless.com/b98036d8-4c4b-8d51-ff42-e6c0e74cf800/v1/files/image1458248856.94247.jpg

i use this one - https://api.backendless.com/b98036d8-4c4b-8d51-ff42-e6c0e74cf800/v1/files/image1458248856.94247.jpg

in my example “file” is BackendlessFile Class and fileUrl is its default property

That is wrong. Please see the documentation:

https://backendless.com/documentation/files/ios/files_file_deletion.htm

It says: “The API to delete a file uses the <path>/<filename> part to identify the file which must be deleted.”

So i suppose it must be files/image1458248856.94247.jpg?

Hi Evgeny!

Please try without “files”.

Hooray! it works! Thanks, Kate!