Backendless Support
 
Assigned to Dev

Backendless.Files.saveFile javascript method return true instead of link

Backendless.Files.saveFile javascript method save the file but doesn't return the url of file uploaded but only "true". Why??

  1. var savedFile = Backendless.Files.saveFile(loggedInUser.ownerId, fotoUser, file, true );
  2. conslole.log(savedFile);

output: true

Leave a Comment

Comments (1)

photo
1

Hi Vincenzo

I have created an internal ticket to fix this issue (BKNDLSS-14050)

In a meantime, as a workaround, you should use asynchronous version of the method :

  1. Backendless.Files.saveFile(loggedInUser.ownerId, fotoUser, file, true, new Backendless.Async(
  2. function onSuccess(fileUrl) {
  3. console.log(fileUrl)
  4. },
  5. function onError(err) {
  6. console.error(err)
  7. }
  8. ))