直传文件
Last updated
2023-07-14 10:21:33
{"value":"## **\u63cf\u8ff0**\n\n\u672c\u63a5\u53e3\u7528\u4e8e\u5728\u4e00\u6b21 HTTP \u4f1a\u8bdd\u4e2d\u4e0a\u4f20\u5355\u4e00\u7684\u4e00\u4e2a\u6587\u4ef6\u3002\n\n\n\n\n\n## **\u8bf7\u6c42**\n\n\n\n**\u8bf7\u6c42\u8bed\u6cd5**\n\n\u8bf7\u6c42\u62a5\u6587\u7684\u5185\u5bb9\u4ee5`multipart\/form-data`\u683c\u5f0f\u7ec4\u7ec7\uff1a\n\n```\nPOST \/ HTTP\/1.1\nHost: <UpHost>\nContent-Type: multipart\/form-data; boundary=<frontier>\nContent-Length: <multipartContentLength>\n\n--<frontier>\nContent-Disposition: form-data; name=\"key\"\n\n<resource_key>\n--<frontier>\nContent-Disposition: form-data; name=\"x:<custom_name>\"\n\n<custom_value>\n--<frontier>\nContent-Disposition: form-data; name=\"token\"\n\n<upload_token>\n--<frontier>\nContent-Disposition: form-data; name=\"crc32\"\n\n<crc32>\n--<frontier>\nContent-Disposition: form-data; name=\"x-qn-meta-<metaKey>\"\n\n<metaValue>\n--<frontier>\nContent-Disposition: form-data; name=\"accept\"\n\n<acceptContentType>\n--<frontier>\nContent-Disposition: form-data; name=\"file\"; filename=\"<fileName>\"\nContent-Type: <contentType>\nContent-Transfer-Encoding: binary\n\n<fileBinaryData>\n--<frontier>--\n```\n\n\n\n\n\n**\u8bf7\u6c42\u5934**\n\n| \u5934\u90e8\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e | |\n| :------- | :--- | :--------- | ---- |\n| Host | \u662f | \u4e0a\u4f20\u57df\u540d\u3002 | |\n\n\n\n\n\n**\u8bf7\u6c42\u5185\u5bb9**\n\n| \u53c2\u6570\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e | |\n| :------------- | :--- | :----------------------------------------------------------- | ---- |\n| resource_key | \u5426 | \u8d44\u6e90\u540d\uff0c\u5fc5\u987b\u662fUTF-8\u7f16\u7801\u3002\u5982\u679c\u4e0a\u4f20\u51ed\u8bc1\u4e2d scope \u6307\u5b9a\u4e3a <bucket>:<key>\uff0c \u5219\u8be5\u5b57\u6bb5\u4e5f\u5fc5\u987b\u6307\u5b9a\uff0c\u5e76\u4e14\u4e0e\u4e0a\u4f20\u51ed\u8bc1\u4e2d\u7684 key \u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5`403`\u9519\u8bef\u3002\u5982\u679c\u8868\u5355\u6ca1\u6709\u6307\u5b9a key\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0a\u4f20\u7b56\u7565saveKey]\u5b57\u6bb5\u6240\u6307\u5b9a\u9b54\u6cd5\u53d8\u91cf\u751f\u6210 Key\uff0c\u5982\u679c\u6ca1\u6709\u6a21\u677f\uff0c\u5219\u4f7f\u7528 Hash \u503c\u4f5c\u4e3a Key\u3002 | |\n| custom_name | \u5426 | \u81ea\u5b9a\u4e49\u53d8\u91cf\u7684\u540d\u5b57\uff0c\u4e0d\u9650\u4e2a\u6570\u3002 | |\n| custom_value | \u5426 | \u81ea\u5b9a\u4e49\u53d8\u91cf\u7684\u503c\u3002 | |\n| upload_token | \u662f | \u4e0a\u4f20\u51ed\u8bc1\uff0c\u4f4d\u4e8e token \u6d88\u606f\u4e2d\u3002 | |\n| crc32 | \u5426 | \u4e0a\u4f20\u5185\u5bb9\u7684 CRC32 \u6821\u9a8c\u7801\u3002\u5982\u679c\u6307\u5b9a\u6b64\u503c\uff0c\u5219\u4e03\u725b\u670d\u52a1\u5668\u4f1a\u4f7f\u7528\u6b64\u503c\u8fdb\u884c\u5185\u5bb9\u68c0\u9a8c\u3002 | |\n| accept | \u5426 | \u5f53 HTTP \u8bf7\u6c42\u6307\u5b9a accept \u5934\u90e8\u65f6\uff0c\u4e03\u725b\u4f1a\u8fd4\u56de Content-Type \u5934\u90e8\u503c\u3002\u8be5\u503c\u7528\u4e8e\u517c\u5bb9\u4f4e\u7248\u672c IE \u6d4f\u89c8\u5668\u884c\u4e3a\u3002\u4f4e\u7248\u672c IE \u6d4f\u89c8\u5668\u5728\u8868\u5355\u4e0a\u4f20\u65f6\uff0c\u8fd4\u56de application\/json \u8868\u793a\u4e0b\u8f7d\uff0c\u8fd4\u56de text\/plain \u624d\u4f1a\u663e\u793a\u8fd4\u56de\u5185\u5bb9\u3002 | |\n| fileName | \u662f | \u539f\u6587\u4ef6\u540d\u3002\u5bf9\u4e8e\u6ca1\u6709\u6587\u4ef6\u540d\u7684\u60c5\u51b5\uff0c\u5efa\u8bae\u586b\u5165\u968f\u673a\u751f\u6210\u7684\u7eaf\u6587\u672c\u5b57\u7b26\u4e32\u3002\u672c\u53c2\u6570\u7684\u503c\u5c06\u4f5c\u4e3a\u9b54\u6cd5\u53d8\u91cf$(fname)\u7684\u503c\u4f7f\u7528\u3002 | |\n| fileBinaryData | \u662f | \u4e0a\u4f20\u6587\u4ef6\u7684\u5b8c\u6574\u5185\u5bb9\u3002 | |\n| x-qn-meta | \u5426 | \u81ea\u5b9a\u4e49\u5143\u6570\u636e\uff0c\u53ef\u540c\u65f6\u81ea\u5b9a\u4e49\u591a\u4e2a\u5143\u6570\u636e\u3002 | |\n\n\n\n\n\n##**\u54cd\u5e94**\n\n### **\u54cd\u5e94\u8bed\u6cd5**\n\n```\nHTTP\/1.1 200 OK\nContent-Type: application\/json\n {\n hash:\"xx\"\n key:\"xx\"\n}\n```\n\n\n\n\n\n### **\u54cd\u5e94\u5934**\n\n\u8be5\u8bf7\u6c42\u64cd\u4f5c\u7684\u5b9e\u73b0\u4f7f\u7528\u4e86\u6240\u6709\u64cd\u4f5c\u7684\u516c\u5171\u54cd\u5e94\u5934\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u67e5\u9605\u516c\u5171\u54cd\u5e94\u5934\u3002\n\n\n\n### **\u54cd\u5e94\u5185\u5bb9**\n\n| \u540d\u79f0 | \u8bf4\u660e |\n| ---- | ---------------------------------------------------------- |\n| hash | \u76ee\u6807\u8d44\u6e90\u7684hash\u503c\uff0c\u53ef\u7528\u4e8e ETag \u5934\u90e8\u3002 \u7c7b\u578b\uff1a\u5b57\u7b26\u4e32 |\n| key | \u76ee\u6807\u8d44\u6e90\u7684\u6700\u7ec8\u540d\u5b57\uff0c\u53ef\u7531\u4e03\u725b\u4e91\u5b58\u50a8\u81ea\u52a8\u547d\u540d\u3002 \u7c7b\u578b\uff1a\u5b57\u7b26\u4e32 |\n\n\n\n### **\u54cd\u5e94\u72b6\u6001\u7801**\n\n\u8be5\u64cd\u4f5c\u7684\u5b9e\u73b0\u4e0d\u4f1a\u8fd4\u56de\u7279\u6b8a\u9519\u8bef\u3002\u6709\u5173\u9519\u8bef\u548c\u9519\u8bef\u4ee3\u7801\u5217\u8868\u7684\u4e00\u822c\u4fe1\u606f\uff0c\u8bf7\u67e5\u9605\u9519\u8bef\u54cd\u5e94\u3002"}