Upload images on WeChat to obtain wxlocalresource: // 498448450243964 stored in the database cannot be displayed on the front-end

Source: Internet
Author: User
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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.