config.php has no restrictions as follows
"UPLOAD_SITEIMG_QINIU" = > array (
)"rootPath" = >". /",
"saveName" => array ("uniqid", ""),
"driver" => "Qiniu",
"driverConfig" => array (
"secrectKey" => "1111",
"accessKey" => "222",
"domain" => "333",
"bucket" => "444",
)),
when uploading
//
$setting=C("UPLOAD_SITEIMG_QINIU");
$Upload = new \Think\Upload($setting);
$info = $Upload->upload($_FILES);
dump($_FILES["pic"]["name"]);
dump($setting);
dump($Upload);
exit;
get
string(6) "32.gif"
array(4) {
["rootPath"] => string(2) "./"
["saveName"] => array(2) {
[0] => string(6) "uniqid"
[1] => string(0) ""
}
["driver"] => string(5) "Qiniu"
["driverConfig"] => array(4) {
["secrectKey"] => string(40) "111"
["accessKey"] => string(40) "222"
["domain"] => string(25) "p0xjmu7mz.bkt.clouddn.com"
["bucket"] => string(7) "333"
}
}
object(Think\Upload)-sharp10 (3) {
["config":"Think\Upload":private] => array(14) {
["mimes"] => array(0) {
}
["maxSize"] => int(0)
["exts"] => array(0) {
}
["autoSub"] => bool(true)
["subName"] => array(2) {
[0] => string(4) "date"
[1] => string(5) "Y-m-d"
}
["rootPath"] => string(2) "./"
["savePath"] => string(0) ""
["saveName"] => array(2) {
[0] => string(6) "uniqid"
[1] => string(0) ""
}
["saveExt"] => string(0) ""
["replace"] => bool(false)
["hash"] => bool(true)
["callback"] => bool(false)
["driver"] => string(5) "Qiniu"
["driverConfig"] => array(4) {
["secrectKey"] => string(40) "111"
["accessKey"] => string(40) "222"
["domain"] => string(25) "p0xjmu7mz.bkt.clouddn.com"
["bucket"] => string(7) "333"
}
}
["error":"Think\Upload":private] => string(24) ""
["uploader":"Think\Upload":private] => object(Think\Upload\Driver\Qiniu)-sharp11 (4) {
["rootPath":"Think\Upload\Driver\Qiniu":private] => string(1) "/"
["error":"Think\Upload\Driver\Qiniu":private] => string(0) ""
["config":"Think\Upload\Driver\Qiniu":private] => array(5) {
["secrectKey"] => string(40) "111"
["accessKey"] => string(40) "222"
["domain"] => string(25) "p0xjmu7mz.bkt.clouddn.com"
["bucket"] => string(7) "333"
["timeout"] => int(300)
}
["qiniu"] => object(Think\Upload\Driver\Qiniu\QiniuStorage)-sharp12 (8) {
["QINIU_RSF_HOST"] => string(18) "http://rsf.qbox.me"
["QINIU_RS_HOST"] => string(17) "http://rs.qbox.me"
["QINIU_UP_HOST"] => string(22) "http://up-z2.qiniu.com"
["timeout"] => int(3600)
["sk"] => string(40) "111"
["ak"] => string(40) "222"
["domain"] => string(25) "333"
["bucket"] => string(7) "444"
}
}
}