概述
Last updated
2023-07-17 16:32:52
{"value":"\u672c\u8282\u8be6\u7ec6\u4ecb\u7ecd\u4e86\uff0cCDNCloud\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u5404\u79cd\u573a\u666f\u7684\u5b89\u5168\u673a\u5236\u548c\u8bbf\u95ee\u8ba4\u8bc1\u673a\u5236\u3002\n\n\u6570\u636e\u5b89\u5168\u6027\u662f\u4e91\u5b58\u50a8\u670d\u52a1\u7684\u91cd\u4e2d\u4e4b\u91cd\u3002\u4e91\u5b58\u50a8\u7684\u5b89\u5168\u673a\u5236\u4e3b\u8981\u9700\u8981\u8003\u8651\u4ee5\u4e0b\u51e0\u4e2a\u56e0\u7d20\uff1a\n\n- \u5982\u4f55\u5224\u65ad\u8be5\u8bf7\u6c42\u65b9\u662f\u5426\u5408\u6cd5\uff0c\u4e14\u5bf9\u76ee\u6807\u7a7a\u95f4\u6709\u76f8\u5e94\u7684\u8bbf\u95ee\u6743\u9650\u3002\n- \u56e0\u4e3a\u670d\u52a1\u7684\u8bbf\u95ee\u534f\u8bae\u540c\u65f6\u652f\u6301 HTTP \u548c HTTPS\uff0c\u670d\u52a1\u7aef\u9700\u8981\u5224\u65ad\u6536\u5230\u7684\u8bf7\u6c42\u662f\u5426\u7ecf\u8fc7\u7be1\u6539\u3002\n- \u76f8\u6bd4\u4e0a\u4f20\u65b0\u8d44\u6e90\uff0c\u8986\u76d6\u6587\u4ef6\u6216\u5220\u9664\u5df2\u6709\u8d44\u6e90\u62e5\u6709\u66f4\u9ad8\u7684\u98ce\u9669\u3002\u56e0\u6b64\u5bf9\u4e0a\u4f20\u6216\u4fee\u6539\u52a8\u4f5c\uff0c\u9700\u8981\u786e\u8ba4\u8bf7\u6c42\u65b9\u662f\u5426\u62e5\u6709\u4fee\u6539\u6216\u5220\u9664\u7684\u6743\u9650\u3002\n\n\u5728\u4f7f\u7528CDNCloud\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u8003\u8651\u5b89\u5168\u673a\u5236\u7684\u573a\u666f\u4e3b\u8981\u6709\u5982\u4e0b\u51e0\u79cd\uff1a\n\n- \u4e0a\u4f20\u8d44\u6e90\n- \u8bbf\u95ee\u8d44\u6e90\n- \u7ba1\u7406\u548c\u4fee\u6539\u8d44\u6e90\n\n\u8fd9\u4e09\u4e2a\u573a\u666f\u9700\u8981\u8003\u8651\u4e0d\u540c\u7684\u5b89\u5168\u56e0\u7d20\uff0c\u56e0\u6b64CDNCloud\u5bf9\u8c61\u5b58\u50a8\u9488\u5bf9\u6027\u7684\u63d0\u4f9b\u4e86\u4e09\u79cd\u5b89\u5168\u673a\u5236\uff1a\u4e0a\u4f20\u51ed\u8bc1\u3001\u4e0b\u8f7d\u51ed\u8bc1]\u548c\u7ba1\u7406\u51ed\u8bc1\u3002\n\n\u56e0\u4e3a\u51ed\u8bc1\u7684\u751f\u6210\u9700\u8981\u7528\u5230SecretKey\uff0c\u56e0\u6b64\u8be5\u751f\u6210\u52a8\u4f5c\u4e0d\u5e94\u5728\u4e0d\u53d7\u4fe1\u4efb\u7684\u73af\u5883\u4e2d\u8fdb\u884c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5f00\u53d1\u8005\u7edd\u4e0d\u80fd\u5c06\u5bc6\u94a5\u5305\u542b\u5728\u5206\u53d1\u7ed9\u6700\u7ec8\u7528\u6237\u7684\u7a0b\u5e8f\u4e2d\uff0c\u65e0\u8bba\u662f\u5305\u542b\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fd8\u662f\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u90fd\u4f1a\u5e26\u6765\u975e\u5e38\u5927\u7684\u5bc6\u94a5\u6cc4\u6f0f\u98ce\u9669\u3002\n\n\u63a8\u8350\u7684\u6a21\u578b\u5982\u4e0b\u6240\u793a\uff1a\n\n![](https:\/\/tp2lravq.hk03.1112oss.com\/202307111352286i9qwpsnmblgqi3ll54w3bjfrfd29t9h.jpg)\n\n\n\n# \u5bc6\u94a5\uff08AccessKey\/SecretKey\uff09\n\n\u5bc6\u94a5\u7528\u4e8e\u4ee5\u4e0a\u51e0\u79cd\u51ed\u8bc1\u7684\u751f\u6210\u3002\u4ee5 SecretKey \u4e3a\u53c2\u6570\uff0c\u914d\u5408\u9002\u5f53\u7684\u7b7e\u540d\u7b97\u6cd5\uff0c\u53ef\u4ee5\u5f97\u5230\u539f\u59cb\u4fe1\u606f\u7684\u6570\u5b57\u7b7e\u540d\uff0c\u9632\u6b62\u5185\u5bb9\u5728\u4f20\u9012\u8fc7\u7a0b\u4e2d\u88ab\u4f2a\u9020\u6216\u7be1\u6539\u3002\n\n\u5bc6\u94a5\u901a\u5e38\u662f\u6210\u5bf9\u521b\u5efa\u548c\u4f7f\u7528\uff0c\u5305\u542b\u4e00\u4e2a AccessKey \u548c\u4e00\u4e2a SecretKey\u3002\u5176\u4e2d AccessKey \u4f1a\u5728\u4f20\u8f93\u4e2d\u5305\u542b\uff0c\u800c\u7528\u6237\u5fc5\u987b\u4fdd\u7ba1\u597d SecretKey \u4e0d\u5728\u7f51\u7edc\u4e0a\u4f20\u8f93\u4ee5\u9632\u6b62\u88ab\u7a83\u53d6\u3002\u82e5 SecretKey \u88ab\u6076\u610f\u7b2c\u4e09\u65b9\u7a83\u53d6\uff0c\u53ef\u80fd\u5bfc\u81f4\u975e\u5e38\u4e25\u91cd\u7684\u6570\u636e\u6cc4\u6f0f\u98ce\u9669\u3002\u56e0\u6b64\uff0c\u5982\u53d1\u73b0 SecretKey \u88ab\u975e\u6cd5\u4f7f\u7528\uff0c\u7ba1\u7406\u5458\u5e94\u7b2c\u4e00\u65f6\u95f4\u5728\u4e03\u725b\u5f00\u53d1\u8005\u5e73\u53f0\u7684\u5bc6\u94a5\u7ba1\u7406\u4e2d\u66f4\u6362\u5bc6\u94a5\u3002\n\n\u5728\u5177\u4f53\u63cf\u8ff0\u5404\u79cd\u51ed\u8bc1\u7684\u8be6\u7ec6\u751f\u6210\u8fc7\u7a0b\u4e2d\u6211\u4eec\u4f1a\u770b\u5230 AccessKey \u548c SecretKey \u662f\u5982\u4f55\u88ab\u4f7f\u7528\u7684\u3002\n\n\n\n# \u4e0a\u4f20\u51ed\u8bc1\uff08UploadToken\uff09\n\n\u5ba2\u6237\u7aef\u4e0a\u4f20\u524d\u9700\u8981\u5148\u83b7\u53d6\u4ece\u670d\u52a1\u7aef\u9881\u53d1\u7684\u4e0a\u4f20\u51ed\u8bc1\uff0c\u5e76\u5728\u4e0a\u4f20\u8d44\u6e90\u65f6\u5c06\u4e0a\u4f20\u51ed\u8bc1\u5305\u542b\u4e3a\u8bf7\u6c42\u5185\u5bb9\u7684\u4e00\u90e8\u5206\u3002\u4e0d\u5e26\u51ed\u8bc1\u6216\u5e26\u975e\u6cd5\u51ed\u8bc1\u7684\u8bf7\u6c42\u5c06\u8fd4\u56de HTTP \u9519\u8bef\u7801 401\uff0c\u4ee3\u8868\u8ba4\u8bc1\u5931\u8d25\u3002\n\n\u751f\u6210\u4e0a\u4f20\u51ed\u8bc1\u65f6\u9700\u8981\u6307\u5b9a\u4ee5\u4e0b\u8981\u7d20\uff1a\n\n- \u6743\u9650\uff0c\u6307\u5b9a\u4e0a\u4f20\u7684\u76ee\u6807\u7a7a\u95f4\u6216\u5141\u8bb8\u8986\u76d6\u7684\u6307\u5b9a\u8d44\u6e90\u3002\n- \u51ed\u8bc1\u6709\u6548\u671f\uff0c\u5373\u4e00\u4e2a\u7b26\u5408Unix\u65f6\u95f4\u6233\u89c4\u8303\u7684\u6570\u503c\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\n **\u6ce8\u610f\uff1a** \u56e0\u4e3a\u65f6\u95f4\u6233\u7684\u521b\u5efa\u548c\u9a8c\u8bc1\u5728\u4e0d\u540c\u7684\u670d\u52a1\u7aef\u8fdb\u884c\uff08\u5728\u4e1a\u52a1\u670d\u52a1\u5668\u521b\u5efa\uff0c\u5728\u4e91\u5b58\u50a8\u670d\u52a1\u5668\u9a8c\u8bc1\uff09\uff0c\u56e0\u6b64\u5f00\u53d1\u8005\u7684\u4e1a\u52a1\u670d\u52a1\u5668\u9700\u8981\u5c3d\u53ef\u80fd\u6821\u51c6\u65f6\u95f4\uff0c\u5426\u5219\u53ef\u80fd\u51fa\u73b0\u51ed\u8bc1\u521a\u521b\u5efa\u5c31\u8fc7\u671f\u7b49\u5404\u79cd\u5947\u602a\u7684\u95ee\u9898\u3002\n- \u53ef\u9009\u62e9\u8bbe\u7f6e\u7684\u6700\u7ec8\u7528\u6237\u6807\u8bc6 ID\u3002\u8fd9\u662f\u4e3a\u4e86\u8ba9\u4e1a\u52a1\u670d\u52a1\u5668\u5728\u6536\u5230\u7ed3\u679c\u56de\u8c03\u65f6\u80fd\u591f\u8bc6\u522b\u4ea7\u751f\u8be5\u8bf7\u6c42\u7684\u6700\u7ec8\u7528\u6237\u4fe1\u606f\u3002\n\n\u6211\u4eec\u4f7f\u7528\u4e0a\u4f20\u7b56\u7565 (PutPolicy)\u4fdd\u5b58\u548c\u4f20\u9012\u8fd9\u4e9b\u8bbe\u7f6e\u3002\u5173\u4e8e\u4e0a\u4f20\u7b56\u7565\u548c\u4e0a\u4f20\u51ed\u8bc1\u7684\u751f\u6210\u7ec6\u8282\uff0c\u8bf7\u67e5\u9605\u4e0a\u4f20\u51ed\u8bc1\n\n\n\n# \u4e0b\u8f7d\u51ed\u8bc1\uff08DownloadToken\uff09\n\n\u4e0b\u8f7d\u79c1\u6709\u8d44\u6e90\u7684\u8bf7\u6c42\u9700\u8981\u5e26\u4e00\u4e2a\u5408\u6cd5\u7684\u4e0b\u8f7d\u51ed\u8bc1\u3002\u4e0d\u5e26\u51ed\u8bc1\u6216\u5e26\u975e\u6cd5\u51ed\u8bc1\u7684\u8bf7\u6c42\u5c06\u8fd4\u56de HTTP \u9519\u8bef\u7801 401\uff0c\u4ee3\u8868\u8ba4\u8bc1\u5931\u8d25\u3002\n\n\u4e0e\u4e0a\u4f20\u51ed\u8bc1\u76f8\u6bd4\uff0c\u4e0b\u8f7d\u51ed\u8bc1\u7684\u4f5c\u7528\u6bd4\u8f83\u7b80\u5355\uff1a\n\n- \u4fdd\u8bc1\u8bf7\u6c42\u53d1\u8d77\u8005\u62e5\u6709\u5bf9\u76ee\u6807\u7a7a\u95f4\u7684\u8bbf\u95ee\u6743\u9650\u3002\n- \u4fdd\u8bc1\u670d\u52a1\u7aef\u6536\u5230\u7684\u4e0b\u8f7d\u8bf7\u6c42\u5185\u5bb9\u672a\u7ecf\u4e2d\u9014\u7be1\u6539\uff0c\u5177\u4f53\u5305\u62ec\u76ee\u6807\u8d44\u6e90\u7684 URI \u548c\u8be5\u8bbf\u95ee\u8bf7\u6c42\u7684\u6709\u6548\u671f\u4fe1\u606f\u5747\u5e94\u672a\u53d7\u5230\u7be1\u6539\u3002\n\n\u5173\u4e8e\u4e0b\u8f7d\u51ed\u8bc1\u7684\u751f\u6210\u7ec6\u8282\uff0c\u8bf7\u67e5\u9605\u4e0b\u8f7d\u51ed\u8bc1\u3002\n\n\n\n# \u9632\u76d7\u94fe\n\n\u4e0b\u8f7d\u8fd8\u6709\u4e00\u79cd\u5e38\u89c1\u7684\u573a\u666f\uff0c\u5373\u516c\u5f00\u8d44\u6e90\u7684\u9632\u76d7\u94fe\uff0c\u4f8b\u5982\u7981\u6b62\u7279\u5b9a\u6765\u6e90\u57df\u540d\u7684\u8bbf\u95ee\uff0c\u7981\u6b62\u975e\u6d4f\u89c8\u5668\u53d1\u8d77\u7684\u8bbf\u95ee\u7b49\u3002\n\n\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 HTTP \u534f\u8bae\u652f\u6301\u7684 Referer \u673a\u5236\u5373HTTP Referer\u6765\u8fdb\u884c\u76f8\u5e94\u7684\u6765\u6e90\u8bc6\u522b\u548c\u7ba1\u7406\u3002\n\n\u9632\u76d7\u94fe\u662f\u4e00\u4e2a\u7cfb\u7edf\u8bbe\u7f6e\uff0c\u4e0d\u5f71\u54cd\u5f00\u53d1\u5de5\u4f5c\u3002\u5982\u53d1\u73b0\u6709\u76d7\u94fe\u60c5\u51b5\uff0c\u5f00\u53d1\u8005\u53ef\u57287OSS\u5e73\u53f0\u91cc\u7684 **\u7a7a\u95f4\u7ba1\u7406**\u4e2d\u7684 **\u7a7a\u95f4\u8bbe\u7f6e** \u8fdb\u884c\u8bbe\u7f6e\u3002\n\n\n\n# \u7ba1\u7406\u51ed\u8bc1\uff08AccessToken\uff09\n\n\u5728\u7ba1\u7406\u73b0\u6709\u8d44\u6e90\u65f6\uff0c\u4f8b\u5982\u67e5\u770b\u8d44\u6e90\u5143\u6570\u636e\u3001\u5220\u9664\u6216\u79fb\u52a8\u8d44\u6e90\u7b49\uff0c\u901a\u5e38\u9700\u8981\u5e26\u4e00\u4e2a\u5408\u6cd5\u7684\u7ba1\u7406\u51ed\u8bc1\u3002\u4e0d\u5e26\u51ed\u8bc1\u6216\u5e26\u975e\u6cd5\u51ed\u8bc1\u7684\u7ba1\u7406\u8bf7\u6c42\u5c06\u8fd4\u56de HTTP \u9519\u8bef\u7801 401\uff0c\u4ee3\u8868\u8ba4\u8bc1\u5931\u8d25\u3002\n\n\u7ba1\u7406\u51ed\u8bc1\u7684\u4f5c\u7528\u4e0e\u4e0b\u8f7d\u51ed\u8bc1\u6bd4\u8f83\u7c7b\u4f3c\uff1a\n\n- \u4fdd\u8bc1\u8bf7\u6c42\u53d1\u8d77\u8005\u62e5\u6709\u5bf9\u76ee\u6807\u7a7a\u95f4\u7684\u7ba1\u7406\u6743\u9650\u3002\n- \u4fdd\u8bc1\u670d\u52a1\u7aef\u6536\u5230\u7684\u7ba1\u7406\u8bf7\u6c42\u5185\u5bb9\u672a\u7ecf\u4e2d\u9014\u7be1\u6539\uff0c\u5177\u4f53\u5305\u62ec\u4ee3\u8868\u7ba1\u7406\u52a8\u4f5c\u7684 URI \u548c\u8be5\u7ba1\u7406\u52a8\u4f5c\u7684\u53c2\u6570\u4fe1\u606f\u5747\u5e94\u672a\u53d7\u5230\u7be1\u6539\u3002\n\n\u5173\u4e8e\u7ba1\u7406\u51ed\u8bc1\u7684\u751f\u6210\u7ec6\u8282\uff0c\u8bf7\u67e5\u9605[\u7ba1\u7406\u51ed\u8bc1\u3002\n\n\n\n# \u8de8\u57df\u8bbf\u95ee\n\n\u51fa\u4e8e\u5b89\u5168\u7684\u8003\u8651\uff0cWeb \u6d4f\u89c8\u5668\u4ece\u5f88\u65e9\u4e4b\u524d\u5c31\u5b9a\u4e0b\u540c\u57df\u5b89\u5168\u7b56\u7565\u7684\u6807\u51c6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u540c\u4e00\u57df\u540d\u4e0b\u7684\u9875\u9762\u53ea\u80fd\u5411\u540c\u57df\uff08\u5305\u62ec CNAME \u57df\u540d\u3001\u7aef\u53e3\uff09\u4e0b\u7684 URL \u53d1\u9001\u6240\u6709\u7c7b\u578b\u7684 HTTP \u8bf7\u6c42\u3002\u800c\u5411\u4e0d\u540c\u57df\u7684\u5730\u5740\u53d1\u9001\u975e GET \u8bf7\u6c42\u65f6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u53ea\u80fd\u8fd4\u56de\u540c\u57df\u5b89\u5168\u7b56\u7565\u9519\u8bef\u3002\n\n\u5bf9\u6b64\uff0c\u5728\u53d1\u8d77\u4e0a\u4f20\u6216\u4e0b\u8f7d\u8bf7\u6c42\u7684\u65f6\u5019\uff0c\u670d\u52a1\u4f1a\u8fd4\u56de\u76f8\u5e94\u7684\u652f\u6301\u8de8\u57df\u7684 Header\uff1a\n\n\u4e0a\u4f20(`upload.qiniup.com`)\n\n```\nAccess-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size\nAccess-Control-Allow-Methods: OPTIONS, HEAD, POST\nAccess-Control-Allow-Origin: *\n```\n\n\u4e0b\u8f7d(`<bucket>.qiniudn.com`)\n\n```\nAccess-Control-Allow-Origin: *\n```\n\n"}