File upload error: undefined. Only on mobile

Hi all,

I have a form that should be able to be completed on either desktop or mobile. Included are several fields for user uploads. All of these are functioning properly on desktop and all throw the error “file upload error: undefined” when I try to upload files during trials on mobile. Included below is the relevant code for one of the upload buttons:

if ($w("#pugShot").value.length > 0) {  // user chose a file
    $w("#pugShot").startUpload()
      .then( (uploadedFile) => {
            $w("#clients").setFieldValue("photo", "https://static.wixstatic.com/media/" + uploadedFile.mediaId);
      } )
      .catch((uploadtesting)=> {
          console.log("file upload error: " + uploadtesting.errorDescription);
      })
  }

Any insight would be greatly appreciated!

Have you tried different devices? Different platforms (iOS, Android)? Different file types?

Is this a new issue? Was it working before?

It might be that there’s something going on in the background that prevents the successful upload. I would suggest reviewing Wix Media: Media Upload Issues and if you are still unable to resolve this issue, contact Wix Customer Care for this as they will be able to help you better.

Hi Yisrael, thanks for the quick response! Unfortunately, I’ve only been able to test on Android so far, but will be testing iOS shortly. This is a new page, so the mobile upload has been throwing the same error since the beginning of testing. I have tried different file types and get the same results.

Another note that I forgot to mention: I had the relevant code in an onChange handler. That is still the case for the desktop, as it works fine there, but the handler failed to trigger on mobile. So for mobile, the code is currently running when the user attempts to navigate to the next page. The code now executes since it’s no longer reliant on the onChange trigger, but I suspect the failure to upload and the trigger failure may be related.

I’ll take another look at the relevant article and do some more testing, but appreciate the suggestion and will reach out to customer care if I can’t find a solution.