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