This article mainly introduces how to use Plupload to directly upload attachments to Qiniu Cloud Storage. if you need this plug-in, you can refer to this plug-in to which users?
1. users who want to download servers in a small space do not have enough bandwidth or space. how can we solve this problem? Make our website an intermediate layer, and then upload the content to the server to Qiniu Cloud Storage. the download is equivalent to the download of Qiniu, which saves both space and bandwidth, solved the possibility that a small space cannot be used as a download site!
2. my server is very good, but sometimes users only upload a few K faster, there is no lack of ISP limit to 64 KB, but not a few K, this actually exists, we also use this as the upload server, and then use the software to regularly download to the server. this is what a website owner currently does.
3. create a document library for others to upload to my cloud space
Such
With regard to this plug-in, JS has to say that the Plupload plug-in is really powerful, and there is a problem with its power. it is complicated. what is complicated? it can be customized, you can implement the desired function by yourself. if you only talk about this plug-in, it will be too difficult. you can refer to the official API. here I am just doing a seven-way demo, you can take a look at uploadify in the front!
Index. php
The code is as follows:
<? Php
Require_once ("./qiniu/io. php ");
Require_once ("./qiniu/rs. php ");
Require_once ("./qiniu/fop. php ");
$ Bucket = "space name ";
$ AccessKey = 'apikey ';
$ SecretKey = 'apikey ';
Qiniu_SetKeys ($ accessKey, $ secretKey );
$ PutPolicy = new Qiniu_RS_PutPolicy ($ bucket );
$ UpToken = $ putPolicy-> Token (null );
?>
Plupload for QINIU