In the image upload to obtain wxlocalresource: 498448450243964 stored in the database cannot be displayed on the front-end how to solve in the image upload to obtain wxlocalresource: // 498448450243964 stored in the database cannot be displayed on the front-end how to solve
Reply content:
Wxlocalresource obtained by uploading images: // 498448450243964 the data stored in the database cannot be displayed on the front end. how can this problem be solved?
This is a temporary local address. you need to obtain the file content from the server and return the http address to the front-end.
You should use the JSSDK Image interface.
Wxlocalresource: // 498448450243964 the local ID list of the photo can only be used in the user's browser.
You also need to use the upload image interface to upload images to the server:
Wx. uploadImage ({localId: 'wxlocalresource: // 100', // The local ID of the image to be uploaded. isShowProgressTips: 1 is obtained by The chooseImage interface. // The default value is 1, success: function (res) {var serverId = res. serverId; // server ID of the returned image }});
After the image is uploaded, it can only be saved on the server for three days. Therefore, you must use the clip retrieval interface on the backend to save the image to your server.
Http request method: GET, https call
Https://api.weixin.qq.com/cgi...
Request example (the example is to use the curl Command to obtain multimedia files)
Curl-I-G "https://api.weixin.qq.com/cgi-bin/media/get?> Access_token = ACCESS_TOKEN & media_id = MEDIA_ID"