Overwriting a file on File Upload

It appears that this ‘overwrite’ parameter doesn’t actually overwrite a file using the fileservice?

.file.upload( PATH, content: DATA , overwrite: BOOL)

Is this possible without having to do the extra API requests to check for existence/delete?

Hi!
It appears that this ‘overwrite’ parameter doesn’t actually overwrite a file using the file service?

Could you clarify: overwrite parameter does not work as expected?

To check if file exists in storage you can use exists( String path ) method in SDK.
For delete operation you can use method remove( String fileUrl ).
This is what you expect?
Regards,
Kate.

No - I actually want to overwrite a file with the same name without having to make two other API calls first.

The ‘upload’ method has a parameter “override” that doesn’t appear to actually overwrite (request fails with an error saying the file exists). I was wondering if this was possible with a single API call.

Hi Joey,

This does not seem to be the proper behavior. Could you please provide the part of your code where you call this method?

ok?

Backendless.sharedInstance().file.upload(“Path/to/File.jpg”, content: DATA, overwrite: true, response: { file in

log.debug("saved : \(file.fileURL)")

}, error: { err in

debugPrint(err)

})

Hi Joey,

This issue is fixed, you can get a fixed lib from github: https://github.com/Backendless/ios-SDK/tree/master/SDK/lib/backendless

For file uploading you also can use FileService ‘saveFile’ method

Dear Kate I have this error when deleting a file (bitmap). help me please…

Backendless.Files.exists("/icon.png");

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.comp.ats/com.example.comp.ats.SubjectsRecyclerListActivity}: BackendlessException{ code: ‘Internal client exception’, message: ‘null’ }