Hi,
I am currently trying to upload a file to the Backendless system with the JavaScript API (v6.2.2) from our Angular application. The upload works as intended, however, the function Backendless.Files.upload(…) returns “Promise<void>” and not a “Promise<string>” or something else for the new URL of the uploaded file.
Is this signature intended and if so, how can I convert the returned value to a string to work with it in my code?
const uploadPath = "/devices/images";
Backendless.Files.upload(file, uploadPath, true)
.then(function(fileUrl) {
// imageUrl: string
device.imageUrl = fileUrl;
})
.catch(function(error) {
//...
});
Thanks in advance,
Tim