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/