JavaScript-WeChat development picture upload problem

Source: Internet
Author: User
Recently in the public platform to do micro-site, which encountered a difficulty, that is the picture upload, input file on the Android phone seems to have a problem, some phones can not choose pictures, more strange upload images uploaded into the server, mobile browser can, before trying webupload pictures upload, Because of this plug-in compatibility is not good, Android part of the mobile phone upload image into an unknown format file exists server, and then gave up, recently released JSSDK inside has mentioned pictures upload, preview and other interfaces, due to contact development soon, these interfaces how to implement is still in the study, No one has ever done a similar demand.

Reply content:

Recently in the public platform to do micro-site, which encountered a difficulty, that is the picture upload, input file on the Android phone seems to have a problem, some phones can not choose pictures, more strange upload images uploaded into the server, mobile browser can, before trying webupload pictures upload, Because of this plug-in compatibility is not good, Android part of the mobile phone upload image into an unknown format file exists server, and then gave up, recently released JSSDK inside has mentioned pictures upload, preview and other interfaces, due to contact development soon, these interfaces how to implement is still in the study, No one has ever done a similar demand.

Take the time to look at the document, your own jssdk inside the picture upload without regard to compatibility and so on. (It may even compress the image for the user)

Probably as follows: Jssdk the uploaded image will return a server ID when successful.
Then go to the multimedia download interface. It's called the media ID, which is actually the server ID in JS. Take this ID to get the user's picture.

All you have to do is to submit the server ID to the server in JS. It is then received on the server and is done through the multimedia interface.

I've been jssdk demo:https://github.com/wjfz/weixin-jssdk.

@ It's really a good idea to live with a madman.
We were the Guide users to the window upload, background access,
Then to the page, the user within 30 minutes of the pictures are displayed, for the user to choose.
Another way is to guide the user to open in the browser.

But the way to recommend lunatics.

@ Crazy Live This idea is not good, the first multimedia interface needs authentication Service number, not the background number can be used. In fact, the multimedia interface upload download has a frequency limit, used as a site image upload method is certainly not appropriate.

How to upload the picture of the store, you know? As if the supplied interface could not be uploaded back to Errorcode=-1

  • 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.