Javascript-php the issue of image uploading in WeChat development?

Source: Internet
Author: User
Keywords Php javascript
The Great Gods, PHP service number development, there is no good picture upload plugin recommended. I find a picture upload plugin, the end does not support.

Reply content:

The Great Gods, PHP service number development, there is no good picture upload plugin recommended. I find a picture upload plugin, the end does not support.

Direct use of HTML5 Fileread, can pass base64 data to the background, background to file save, plug-in words uploadify/uploadifive

The recommended image interface Uploadimage is then pulled to the local server

  $url ='通过api获取到的图片地址';    $filename='图片名称.jpg';  $hander = curl_init();  $fp = fopen($filename,'wb');  curl_setopt($hander,CURLOPT_URL,$url);  curl_setopt($hander,CURLOPT_FILE,$fp);  curl_setopt($hander,CURLOPT_HEADER,0);  curl_setopt($hander,CURLOPT_FOLLOWLOCATION,1);  //curl_setopt($hander,CURLOPT_RETURNTRANSFER,false);//以数据流的方式返回数据,当为false是直接显示出来  curl_setopt($hander,CURLOPT_TIMEOUT,60);  curl_exec($hander);  curl_close($hander);  fclose($fp);  Return true;

1. Upstairs said, with the provided image upload solution, the advantage is compatible with all mobile phones, the disadvantage is only save three days, not permanently saved, but also need to manually pull back.
2. Baidu Web Uploader, the compatibility of mobile phone upload is also good, Android 4.3+uc perfect use, but it is estimated that there will still be a part of the phone in the gun can not be used.

In fact, the relationship with PHP is not big, more is to see your front-end implementation. Think about base64?

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