I encountered the problem, that the upload of pictures doesn’t work on some devices.
I am using startUpload, but the then()-clause is just never invoked. catch() and finally() are not called as well. Here is the full code:
$w.onReady(function () {
let defaultImage = $w("#image").src;
$w("#uploadButton").onChange(() => {
if ($w("#uploadButton").value.length > 0) {
// To prevent showing the previous image once a new one is uploaded
$w("#image").src="";
$w("#uploadButton").startUpload()
.then((uploadedFile) => {
$w("#image").src = uploadedFile.url;
})
.catch(err => {
console.log(err, "Something went wrong")
})
} else {
// If the user clicks X on the upload button, reset the image to the default one
$w("#image").src = defaultImage;
}
})
});
I have access to one of the devices and was able to do some testing.
Curiously, the Wix example from the Wix website works fine on this device:
https://www.wix.com/corvid-examples/file-preloader
But even if I copy the whole project and publish it from my account the problem occurs again:
https://ilijass4.wixsite.com/meinewebsite
There are several mobile devices with this problem, the one I have access to is an iPhone 6 with IOS12. On this device the Problem occurs with Safari, Chrome and Firefox .
There are plenty devices on wich it works perfectly, and desktop versions work as well.
I really hope that someone has an Idea, what the reason can be.
Regards
Ilijas