This is the development of file upload on Kingsoft cloud web page.Code
The accesskey and scecert of Kingsoft cloud must be used.
I uploaded 5g files successfully. Haha
As a PHP Web Page
In addition, you can directly write a blog and upload it.
<? PHP # $ access_id is your accessid # $ access_key is your accesssecretkey # $ key is upload filename # $ bucket_name is your bucketname # $ host is server address # $ URL is $ host/$ bucketname # $ policy is the rule you make for MERs # $ policy has success_action_redirect to allow your redirect your address # $ sign is credentials # policy must include expiration and condition key, condition bucket # form item ex Cept "kssaccesskeyid", "signature", "file", "policy", "Bucket", "key ", # Must be include in the Policy $ access_id = 'your access id'; $ access_key = "your secret key"; $ key = 'Your file name prefix '; $ bucket_name = "Your bucketname"; $ host = "http://kss.ksyun.com/"; $ url = $ host. $ bucket_name; function iso8601 ($ time = false) {if ($ time = false) $ time = Time (); $ date = Date ('Y-m-d \ th: I: S \. z', $ time); Return (Substr ($ date, 0, strlen ($ date)-2 ). 'Z');} function def_policy () {Global $ key; global $ redirect; $ t = time () + (3600*24 ); $ exp = iso8601 ($ T); $ policy = "{\" Expiration \ ": \" $ exp \ ", \" conditions \": [{\ "Bucket \": \ "your bucket name \"}, [\ "starts-with \", \ "\ $ key \", \ "$ key \"], {\ "success_action_redirect \": \ "$ redirect \"}, [\ "EQ \", \ "\ $ Content-Type \", \ "text/html \"]} "; return $ policy;} function cal_sign ($ Policy) {GL Obal $ access_key; $ Sign = base64_encode (hash_hmac ('sha1', $ policy, $ access_key, true); return $ sign ;}; $ policy = def_policy (); $ policy = base64_encode ($ policy); $ Sign = cal_sign ($ policy);?> <HTML>
Entry: upload blog form # file: <input type = "file" name = "file"/> <br/> # <input type = "Submit" name = "Submit" value = "upload to KSS S3 "/> upload the file in the form of your blog post goes here.