WAP side of the picture upload is how to do, as the figure

Source: Internet
Author: User
Keywords PHP WeChat browser image upload
Tags form post

How does the image upload on the WAP side work?
Click Add, read the picture of the phone, OK back to add the interface, you can continue to add pictures
Similar:

You know, my friend, please guide me.
Remark: I frame is yii2.0, if have yii plug-in more good

Reply content:

How does the image upload on the WAP side work?
Click Add, read the picture of the phone, OK back to add the interface, you can continue to add pictures
Similar:

You know, my friend, please guide me.
Remark: I frame is yii2.0, if have yii plug-in more good

This is still a bit of experience.

Issues with inconsistent upload buttons

First from the upload button said, the default effect is ugly, and different operating systems, different browsers, about the upload button to beautify the Web a lot. General idea:

        

It will be input upload positioned with relative to Contianer, input z-index stacked on .upload top of it, and opcity = 0; .upload For example, you put a "picture button", "Font icon plus" and so on ...

File Ajax uploads

The browser Ajax itself does not support uploading binaries directly, which means that traditional methods must use the From Form post implementation. But HTML5 has added a file API to make Ajax file uploads an easy thing to do. Specific implementation

http://www.html5rocks.com/zh/tutorials/file/xhr2/

Above this article has talked about, speak very good oneself look the problem is not big, or own Baidu, Google html5 Ajax 文件上传 File API .

Upload to Server

The file to the server is assumed to return, this time abc.png your front-end JS Ajxa the picture dynamically written to the page.

$.ajax({    type : 'post',    url  : 'server/upload',    data : {data: 'fromData'},    success : function(data) {        // 这里假设返回的 data = 'abc.png'        $('ul').append('
  • '); }})

    Add: Multiple picture problems

    If you are uploading multiple images, for the front end, input adds a multiple attribute to

    As to limit the number of users, when the user Change event to determine the number of files can be resolved. JSON format for returning picture information after the server finishes processing, for example:

    ["upload/1.png", "upload/2.png", "upload/3.png"]

    The front end converts the JSON to a JavaScript object and then appends it to the page. In fact, the biggest problem is the use of the HTML5 file API, this master is very good processing.

    Previously written, 可能不完善 you can refer to the reference

    Http://www.cnblogs.com/chenshuo/p/3895745.html

    Use of JSSDK

    If it is based on the development, the recommended implementation of the Jssdk file upload, the user experience is very good, their own upload unless you server configuration crane, bandwidth local tyrants level, or your own upload is still problematic. If you stick with your own, you can also dedicate to an upload server (file storage server) so that the file upload a large amount of bandwidth will not affect the other business.

    Realize:

      1. First of all your detailed look at the jssdk about uploading this piece of stuff, your own exploration under the problem is not big;

      2. I mainly want to say is in the actual development, JSSDK file upload by default is a single file upload, looking for a long time to find a way, you may use, paste out

    Image upload Interface multi-image upload (recursive upload) http://www.cnblogs.com/chenshuo/p/4838592.html

    This is the Official document: Https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738729&token=&lang=zh_CN

    Like the development of their own, page style, image upload is written by their own.

    1, or the picture uploaded to seven cows and other clouds, get URLs made of this page style
    2, either call their own upload image sdk,http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#. E4. B8.8a.e4.bc.a0.e5.9b.be.e7.89.87.e6.8e.a5.e5.8f.a3
    3, either use the Base64 to the picture processing under.

    Within the JSSDK, ordinary mobile web and desktop Web upload no difference.

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