Seven Qiniu storage-how to upload large files to the seven Cow cloud store using PHP?

Source: Internet
Author: User
Tags crc32
According to the official document written simple upload, upload a larger file or Chinese name file will fail, how to solve?
index.php

index.php

upload.php

upload.php    
  
   Token(null);$putExtra = new Qiniu_PutExtra();$putExtra->Crc32 = 1;list($ret, $err) = Qiniu_PutFile($upToken, $key1,$_FILES["file"]["tmp_name"], $putExtra);echo "====> Qiniu_PutFile result: \n";if ($err !== null) {    var_dump($err);} else {    var_dump($ret);}if ($_FILES["file"]["error"] > 0)  {  echo "Error: " . $_FILES["file"]["error"] . "
"; }else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; }?>?>

Reply content:

According to the official document written simple upload, upload a larger file or Chinese name file will fail, how to solve?
index.php

index.php

upload.php

  upload.php!--? php require_once ("qiniu/io.php"); Require_once ("qiniu/ Rs.php "); $bucket =" Mapledisk "; $key 1 = $_files[" file "[" name "]; $accessKey = ' ———— '; $secretKey = ' ———— '; Qiniu_setkeys ($accessKey, $secretKey); $putPolicy = new Qiniu_rs_putpolicy ($bucket); $upToken = $putPolicy--->token ( NULL); $putExtra = new Qiniu_putextra (); $putExtra->crc32 = 1;list ($ret, $err) = Qiniu_putfile ($upToken, $key 1,$_files ["File"] ["Tmp_name"], $putExtra); echo "====> qiniu_putfile result: \ n"; if ($err!== null) {var_dump ($err);} else {Var_d UMP ($ret);} if ($_files["file" ["error"] > 0) {echo "Error:". $_files["File" ["Error"].  "
"; }else {echo "Upload:". $_files["File" ["Name"]. "
"; echo "Type:". $_files["File" ["type"]. "
"; echo "Size:". ($_files["File" ["Size"]/1024). "Kb
"; echo "Stored in:". $_files["File" ["Tmp_name"]; }?>?>

Try it ... Qiniu_Rio_PutFile(...)

or directly from the Web page to seven of cattle server transmission ... There is a plupload front-end SDK based ...

Here are examples and code downloads: http://7niu.sinaapp.com/

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