{"id":1759,"date":"2019-08-30T17:26:29","date_gmt":"2019-08-30T09:26:29","guid":{"rendered":"https:\/\/www.xiaobo.li\/?p=1759"},"modified":"2019-08-30T17:26:29","modified_gmt":"2019-08-30T09:26:29","slug":"jfileserver-examples","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/1759","title":{"rendered":"jFileServer examples"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528\u6237\u4f7f\u7528 (Token \u6388\u6743)<br>\n\u4e0a\u4f20\uff1a  POST: \/file\/upload<br>\n    bucket={xxx}<br>\n    token={xxx}<br>\n    path={xxx}  \/\/ \u53ef\u9009\u9879\uff0c\u4e0d\u8f93\u5165\u5219\u81ea\u52a8\u751f\u6210\u8def\u5f84<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bbf\u95ee\uff1a  GET:  \/file\/get?path={xxx}&amp;token={xxx}&amp;download=0&amp;downname={xxx}<br>\n    download: \u4e3a\u53ef\u9009\u9879\uff0c\u8bbe\u4e3a2\u65f6\u4ee5\u5185\u8054\u6587\u6863\u6253\u5f00\uff08\u4e00\u822c\u7528\u4e8e\u9884\u89c8\uff09\uff0c\u8bbe\u4e3a1\u65f6\u4ee5\u8d44\u6e90\u4e0b\u8f7d\u65b9\u5f0f\u5904\u7406\uff0c\u4e0d\u8bbe\u7f6e\u6216\u4e3a0\u65f6\u5219\u662f\u4ee5\u6d4f\u89c8\u5668\u9ed8\u8ba4\u65b9\u5f0f\u5904\u7406<br>\n    downname: \u4e3a\u53ef\u9009\u9879\uff0cdownload = 1 \u65f6\uff0c\u6587\u4ef6\u4e0b\u8f7d\u7684\u540d\u79f0\uff0c\u4e0d\u8bbe\u7f6e\u5219\u4ee5\u9ed8\u8ba4\u8def\u5f84\u540d<br>\n    fsatoken: \u53ef\u9009\u9879\uff0c\u4f1a\u8bdd\u6388\u6743\u8bbf\u95ee\u6807\u8bc6\uff0c\u4ececookie\u83b7\u53d6<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">===============================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a7\u5236\u4f7f\u7528 (Basic Auth \u6388\u6743)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">POST: \/control\/delete<br>\n    path={xxx}<br>\nPOST: \/control\/upload<br>\n    bucket={xxx}<br>\n    path={xxx}  \/\/ \u53ef\u9009\u9879\uff0c\u4e0d\u8f93\u5165\u5219\u81ea\u52a8\u751f\u6210\u8def\u5f84<br>\nGET:  \/control\/getaccesstoken?path={xxx},{xxx},{xxx},{xxx}&amp;fsatoken={xxx}&amp;ttl={xxx}<br>\nGET:  \/control\/getuploadtoken?bucket={xxx},{xxx},{xxx},{xxx}<br>\n    ttl: \u53ef\u9009\u9879\uff0c\u6388\u6743\u8d85\u65f6\u65f6\u95f4\uff0c\u9ed8\u8ba4\u7531\u670d\u52a1\u914d\u7f6e\u5b9a\u4e49<br>\n    fsatoken: \u53ef\u9009\u9879\uff0c\u4f1a\u8bdd\u6388\u6743\u6807\u8bc6, fsatoken\u5b58\u50a8\u4e8e\u5ba2\u6237cookie, \u540c\u4e00fsatoken\u7684token\u6388\u6743\u5141\u8bb8\u591a\u6b21\u8bbf\u95ee\uff0c\u968f\u4f1a\u8bdd\u5931\u6548\u800c\u5931\u6548<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">================================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8def\u5f84\u6784\u6210\uff1a<br>     \u7269\u7406\u5b58\u50a8\u8def\u5f84 + \u6876\u540d + \u5b58\u50a8\u8def\u5f84(\u5fc5\u9700\u4ee5 \/\u4e3a\u5f00\u59cb)<br>     \/file\/ + mybucket + \/2017\/00\/11.jpg<br>     \/file\/ + mybucket + \/af\/ce\/head.jpg<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b58\u50a8\u8def\u5f84\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/file\/mybucket\/2017\/00\/11.jpg<br>\/file\/mybucket\/af\/ce\/head.jpg<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bbf\u95ee\u5730\u5740\uff1a    <br>\n    \u79c1\u6876\u4e0b\u8f7d<br>\n    http:\/\/file.example.com\/a\/{bucket}{path}?token={xxx}&amp;download=1<br>\n    \u79c1\u6876\u8bbf\u95ee<br>\n    http:\/\/file.example.com\/a\/{bucket}{path}?token={xxx}<br>\n    \u516c\u6876\u4e0b\u8f7d<br>\n    http:\/\/file.example.com\/a\/{bucket}{path}?download=1<br>\n    \u516c\u6876\u8bbf\u95ee<br>\n    http:\/\/file.example.com\/a\/{bucket}{path}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">================================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6388\u6743<br>\n    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5747\u4e3atoken\u6388\u6743\uff0c\u901a\u8fc7\u914d\u7f6e\u6876\u6388\u6743\u53ef\u5141\u8bb8\u8bbe\u7f6e\u4e3a\u5f00\u653e\u8bbf\u95ee\uff0c\u7ea7\u522b\u5230 \u6876<br>\n    \u9ed8\u8ba4\u516c\u5f00\u6876\u4e3a p (public\u7684\u7b80\u5199)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528\u6237\u4f7f\u7528 (Token \u6388\u6743) \u4e0a\u4f20\uff1a POST: \/file\/upload b &hellip; <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/1759\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[283],"tags":[],"class_list":["post-1759","post","type-post","status-publish","format-standard","hentry","category-technologys"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=1759"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1759\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=1759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=1759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=1759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}