Scope = ' My-bucket:sunflower.jpg '
Deadline = 1451491200
Returnbody = ' {
"Name": $ (fname),
"Size": $ (fsize),
"W": $ (imageinfo.width),
"H": $ (imageinfo.height),
"Hash": $ (ETag)
}'
Putpolicy = ' {' scope ': ' my-bucket:sunflower.jpg ', ' deadline ': 1451491200, ' returnbody ': ' {\ ' name\ ': $ (fname), \ "Size\": $ (fsize), \ "w\": $ (imageinfo.width), \ "H\": $ (imageinfo.height), \ "Hash\": $ (ETag)} "} '
Encodedputpolicy = Urlsafe_base64_encode (putpolicy)
Sign = HMAC_SHA1 (Encodedputpolicy, "")
Encodedsign = "Wq4ofysef1r7iknrziqtomqydvi="
Uploadtoken = AccessKey + ': ' + encodedsign + ': ' + encodedputpolicy
I use HTML to submit pictures, upload to http://upload.qiniu.com/, backstage with PHP,
How do I build the backend, how to get Uptoken through Ajax, is not understand this API
Reply content:
Scope = ' My-bucket:sunflower.jpg '
Deadline = 1451491200
Returnbody = ' {
"Name": $ (fname),
"Size": $ (fsize),
"W": $ (imageinfo.width),
"H": $ (imageinfo.height),
"Hash": $ (ETag)
}'
Putpolicy = ' {' scope ': ' my-bucket:sunflower.jpg ', ' deadline ': 1451491200, ' returnbody ': ' {\ ' name\ ': $ (fname), \ "Size\": $ (fsize), \ "w\": $ (imageinfo.width), \ "H\": $ (imageinfo.height), \ "Hash\": $ (ETag)} "} '
Encodedputpolicy = Urlsafe_base64_encode (putpolicy)
Sign = HMAC_SHA1 (Encodedputpolicy, "")
Encodedsign = "Wq4ofysef1r7iknrziqtomqydvi="
Uploadtoken = AccessKey + ': ' + encodedsign + ': ' + encodedputpolicy
I use HTML to submit pictures, upload to http://upload.qiniu.com/, backstage with PHP,
How do I build the backend, how to get Uptoken through Ajax, is not understand this API
Using PHP in the background, the seven bull Php-sdk directly in the upload voucher of the entire generation process, https://github.com/qiniu/php-sdk/blob/v6/qiniu/rs.php#L67, In addition you can directly refer to the upload demo, easy to understand, https://github.com/qiniu/php-sdk/blob/v6/demo/up.php