下载凭证
Last updated
2023-07-11 15:54:38
{"value":"\u4e0b\u8f7d\u51ed\u8bc1\u662f\u7528\u4e8e\u5bf9\u79c1\u6709\u8d44\u6e90\u4e0b\u8f7d\u7684\u6388\u6743\uff0c\u901a\u8fc7\u6388\u6743\u5ba2\u6237\u7aef\uff0c\u4f7f\u5176\u5177\u5907\u8bbf\u95ee\u6307\u5b9a\u79c1\u6709\u8d44\u6e90\u7684\u80fd\u529b\u3002\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\u4e0b\u8f7d\u516c\u5f00\u7a7a\u95f4\u8d44\u6e90\u4e0d\u9700\u8981\u4e0b\u8f7d\u51ed\u8bc1\u3002\n\n\n\n# \u7b97\u6cd5\n\n1.\u6784\u9020\u4e0b\u8f7d URL\uff1a\n![](https:\/\/tp2lravq.hk03.1112oss.com\/20230711155031vrnbrw8blwaj3jllfpgoew32f5fjmi59.png)\n\n2.\u4e3a\u4e0b\u8f7d URL \u52a0\u4e0a\u8fc7\u671f\u65f6\u95f4 e \u53c2\u6570\uff0cUnix\u65f6\u95f4\u6233\n\n```\nDownloadUrl = 'http:\/\/78re52.com1.z0.glb.clouddn.com\/resource\/flower.jpg?e=1451491200'\n```\n\n3.\u5bf9\u4e0a\u4e00\u6b65\u5f97\u5230\u7684 URL \u5b57\u7b26\u4e32\u8ba1\u7b97HMAC-SHA1\u7b7e\u540d\uff08\u5047\u8bbe\u8bbf\u95ee\u5bc6\u94a5\uff08AK\/SK\uff09\u662f **MY_SECRET_KEY**\uff09\uff0c\u5e76\u5bf9\u7ed3\u679c\u505aURL \u5b89\u5168\u7684 Base64 \u7f16\u7801]\n\n```\nSign = hmac_sha1(DownloadUrl, 'MY_SECRET_KEY')\nEncodedSign = urlsafe_base64_encode(Sign)\n```\n\n4.\u5c06\u8bbf\u95ee\u5bc6\u94a5\uff08AK\/SK\uff09\uff08\u5047\u8bbe\u662f **MY_ACCESS_KEY**\uff09\u4e0e\u4e0a\u4e00\u6b65\u8ba1\u7b97\u5f97\u5230\u7684\u7ed3\u679c\u7528\u82f1\u6587\u7b26\u53f7 : \u8fde\u63a5\u8d77\u6765\uff1a\n```\nToken = 'MY_ACCESS_KEY:438dd8pXocjYuF-6dTcKMtETB2g='\n```\n\n\n5.\u5c06\u4e0a\u8ff0 **Token** \u62fc\u63a5\u5230\u542b\u8fc7\u671f\u65f6\u95f4\u53c2\u6570 e \u7684 **DownloadUrl** \u4e4b\u540e\uff0c\u4f5c\u4e3a\u6700\u540e\u7684\u4e0b\u8f7d URL\uff1a\n\n```\nRealDownloadUrl = 'http:\/\/78re52.com1.z0.glb.clouddn.com\/resource\/flower.jpg?e=1451491200&token=MY_ACCESS_KEY:438dd8pXocjYuF-6dTcKMtETB2g='\n```\n\n**RealDownloadUrl** \u5373\u4e3a\u4e0b\u8f7d\u5bf9\u5e94\u79c1\u6709\u8d44\u6e90\u7684\u53ef\u7528 URL (\u5e26\u6709\u53c2\u6570\u7684\u60c5\u51b5\u4e0b,\u9700\u8981\u5c06query\u4e00\u8d77\u8fdb\u884c\u7b7e\u540d)\uff0c\u5e76\u5728\u6307\u5b9a\u65f6\u95f4\u540e\u5931\u6548\u3002\u5931\u6548\u540e\uff0c\u53ef\u6309\u9700\u8981\u91cd\u65b0\u751f\u6210\u4e0b\u8f7d\u51ed\u8bc1\u3002\n\n**\u6ce8\u610f**\uff1a\n\n- \u4e3a\u786e\u4fdd\u5ba2\u6237\u7aef\u3001\u4e1a\u52a1\u670d\u52a1\u5668\u548c\u79c1\u6709\u4e91\u5b58\u50a8\u670d\u52a1\u5668\u5bf9\u4e8e\u6388\u6743\u622a\u6b62\u65f6\u95f4\u7684\u7406\u89e3\u4fdd\u6301\u4e00\u81f4\uff0c\u9700\u8981\u540c\u6b65\u6821\u51c6\u5404\u81ea\u7684\u65f6\u949f\u3002\u9891\u7e41\u8fd4\u56de 401 \u72b6\u6001\u7801\u65f6\u8bf7\u5148\u68c0\u67e5\u65f6\u949f\u540c\u6b65\u6027\u4e0e\u751f\u6210 e \u53c2\u6570\u503c\u7684\u4ee3\u7801\u903b\u8f91\u3002\n- token \u5fc5\u987b\u653e\u5728\u8bf7\u6c42\u7684\u6700\u540e\uff0ctoken \u4e4b\u540e\u7684\u53c2\u6570\u4f1a\u88ab\u5ffd\u7565\u3002\u4ee5\u8bf7\u6c42 `http:\/\/test.cinem.net\/aaaa.jpg?e=1778754963&token=sQvk4AXf0rEkzcytkr...XjI0M:zwvwiM0wsMBRj46xcby05U=&attname=geral_TS-PFS3010-8ET`\u4e3a\u4f8b,\u6b64\u65f6`attname=geral_TS-PFS3010-8ET`\u4f1a\u88ab\u5ffd\u7565\uff0c\u5e76\u4e0d\u751f\u6548\u3002\n- \u5bf9\u4e8e\u5305\u542b\u4e2d\u6587\u6216\u5176\u5b83\u975e\u82f1\u6587\u5b57\u7b26\u7684 Key\uff0c\u9700\u8981\u505a\u5230\u4ee5\u4e0b\u4e24\u70b9\uff1a\n - Key \u672c\u8eab\u8981\u505a UTF-8 \u7f16\u7801\n - \u4e3a URL \u7b7e\u540d\u4e4b\u524d\uff0c\u5bf9 Path \u90e8\u5206\uff08\u4e0d\u542b\u524d\u5bfc \/ \u7b26\u53f7\uff0c\u901a\u5e38\u5c31\u662f Key \u672c\u8eab\uff0c\u5373\u4e0a\u4f8b\u4e2d\u7684 resource\/flower.jpg\uff09\u505a\u4e00\u6b21URL \u5b89\u5168\u7684 Base64 \u7f16\u7801\u3002\n\n\n\n# \u793a\u4f8b\n\n\u4e0b\u8f7d\u51ed\u8bc1\u4e0d\u9700\u8981\u5355\u72ec\u751f\u6210\uff0c\u79c1\u6709\u4e91\u5b58\u50a8\u652f\u6301\u7684\u670d\u52a1\u7aef\u8bed\u8a00 SDK \u90fd\u63d0\u4f9b\u4e86\u751f\u6210\u5b8c\u6574\u4e0b\u8f7d\u79c1\u6709\u8d44\u6e90 URL \u7684\u65b9\u6cd5\uff08\u5305\u542b\u4e0b\u8f7d\u51ed\u8bc1\uff09\uff0c\u5404 SDK \u7684\u5bf9\u5e94\u5165\u53e3\u5982\u4e0b\uff1a\n\n\u00b7 [Java](https:\/\/github.com\/CDNCloudForU\/java-sdk)\n\u00b7 [Python](https:\/\/github.com\/CDNCloudForU\/python-sdk)\n\u00b7 [PHP](https:\/\/github.com\/CDNCloudForU\/php-sdk)\n\u00b7 [Go](https:\/\/github.com\/CDNCloudForU\/api.v7)\n\u00b7 [Android](https:\/\/github.com\/CDNCloudForU\/android-sdk)\n\u00b7 [iOS](https:\/\/github.com\/CDNCloudForU\/objc-sdk)\n\u00b7 [Node.js](https:\/\/github.com\/CDNCloudForU\/nodejs-sdk)\n\u00b7 [JavaScript](https:\/\/github.com\/CDNCloudForU\/js-sdk)\n\u00b7 [C\/C++](https:\/\/github.com\/CDNCloudForU\/c-sdk\/releases)\n\u00b7 [C#](https:\/\/github.com\/CDNCloudForU\/csharp-sdk)"}