PHP submits the picture form to the seven bull Cloud

Source: Internet
Author: User

1. Download the latest PHP-SDK

Comment out the second half of the Qiniu\examples upload.php, leaving only the $token variable

Write in index.php

<?PHPrequire_once' Qiniu/examples/upload.php ';? ><script type= "Text/javascript" src= "Http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js" ></ Script><script type= "Text/javascript" >functionSaveReport () {varform =NewFormData (document.getElementById ("Savereportform")); varreq =NewXMLHttpRequest (); Req. Open ("Post", "http://up-z2.qiniu.com/",false); Req.send (form); if(Req.readystate = = 4){                   if(Req.status = = | | req.status = = 0){                        //alert (req.responsetext);                        varobj = Json.parse (req.responsetext); //alert (Obj.key);                        document.getElementById ("File"). value = null; document.getElementById ("File"). Value = "Your seven Qiniu outside the chain Default domain name/" +obj.key;document.getElementById ("img"). Value =NULL; Document. getElementById ("img"). InnerHTML = "Key+ "\" > "            }        }                             return false;//must return false, otherwise the form commits itself again, and the page jumps    } </script><form id= "Savereportform" method= "post" action= "http://up-z2.qiniu.com/" enctype= "multipart/ Form-data "onsubmit=" return SaveReport (); " > <input name= "token" type= "hidden" value= "<?=$token?> "> <input onchange=" document.getElementById (' file '). Value=this.value "name=" file "type=" file "/> < Input type= "Submit" ></form><div id= "img" ></div>

Did not finish to be continued

PHP submits the picture form to the seven bull Cloud

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.