Solution to WeChat applet file upload failure
1. Phenomenon
I updated the mini program today and found that I couldn't start taking photos or selecting photos for file upload. When I clicked the upload button, there was no response or any error. I was immediately confused. Finally, I had an idea and remembered that WeChat recently updated its privacy agreement, which is required for file uploads.
wx.chooseImage、wx.chooseMedia、wx.chooseVideo
wx.authorize({scope: ‘scope.camera’})、wx.createVKSession、
These interfaces need to be declared in the privacy agreement before they can be used. Finally, I added these two permissions in the privacy agreement, and the file can be uploaded again.
How to create a privacy agreement pop-up window, please refer to the previous blog
WeChat mini program new privacy agreement pop-up window implements the latest version
2. Solution
-
Log in to the WeChat open platform and enter the mini program backend
-
Select version management, select the latest version, and submit for review
-
Enter the review page and scroll to the bottom to "Update Privacy Agreement"
-
On the privacy agreement page, **[Add information type]** adds permissions for camera, selected photo or video information. Update user privacy agreement
-
Republish mini program