{"id":1662,"date":"2024-11-10T16:50:32","date_gmt":"2024-11-10T08:50:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1662\/"},"modified":"2024-11-10T16:50:32","modified_gmt":"2024-11-10T08:50:32","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-input-%e6%96%87%e4%bb%b6%e9%80%89%e6%8b%a9%e5%99%a8%e4%bb%85%e5%85%81%e8%ae%b8%e9%80%89%e6%8b%a9%e7%89%b9%e5%ae%9a%e6%96%87%e4%bb%b6%e7%b1%bb%e5%9e%8b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1662\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 input \u6587\u4ef6\u9009\u62e9\u5668\u4ec5\u5141\u8bb8\u9009\u62e9\u7279\u5b9a\u6587\u4ef6\u7c7b\u578b\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173052849262779.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 input \u6587\u4ef6\u9009\u62e9\u5668\u4ec5\u5141\u8bb8\u9009\u62e9\u7279\u5b9a\u6587\u4ef6\u7c7b\u578b\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 input \u6587\u4ef6\u9009\u62e9\u5668\u4ec5\u5141\u8bb8\u9009\u62e9\u7279\u5b9a\u6587\u4ef6\u7c7b\u578b\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>input \u6587\u4ef6\u9009\u62e9\u5668\u8bbe\u7f6e mime \u7c7b\u578b\u95ee\u9898<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u5982\u4f55\u5728 input \u6587\u4ef6\u9009\u62e9\u5668\u4e2d\u8bbe\u7f6e MIME \u7c7b\u578b\uff0c\u4ec5\u5141\u8bb8\u9009\u62e9\u7279\u5b9a\u7684\u6587\u4ef6\u7c7b\u578b\uff08\u4f8b\u5982 xls\u3001xlsx \u548c csv\uff09\uff1f<\/p>\n<p><strong>\u5177\u4f53\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u867d\u7136\u5df2\u8bbe\u7f6e accept \u5c5e\u6027\uff0c\u4f46 csv \u6587\u4ef6\u7c7b\u578b\u4f3c\u4e4e\u65e0\u6cd5\u751f\u6548\u3002<\/p>\n<p><strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre>&lt;input type=\"file\"\n       id=\"avatar\" name=\"avatar\"\n       accept=\"application\/vnd.ms-excel,application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text\/csv\"&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u8fd0\u884c\u622a\u56fe\uff1a<\/strong><\/p>\n<p>![\u6587\u4ef6\u9009\u62e9\u5668\u622a\u56fe\uff0c\u4ec5\u663e\u793a xls \u548c xlsx \u6587\u4ef6\u7c7b\u578b]**<\/p>\n<p><strong>\u7b54\u6848\uff1a<\/strong><\/p>\n<p>\u4e3a\u4e86\u4f7f csv \u6587\u4ef6\u7c7b\u578b\u751f\u6548\uff0c\u53ef\u4ee5\u6dfb\u52a0\u989d\u5916\u7684 accept \u503c\uff1a<\/p>\n<pre>accept=\"..., .csv\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a MIME \u7c7b\u578b\u53ea\u5339\u914d MIME \u7c7b\u578b\u524d\u9762\u7684\u6269\u5c55\u540d\uff0c\u800c\u4e0d\u4f1a\u5339\u914d\u6587\u4ef6\u6269\u5c55\u540d\u524d\u9762\u7684 MIME \u7c7b\u578b\u3002<\/p>\n<p><strong>\u4fee\u6539\u540e\u7684\u4ee3\u7801\uff1a<\/strong><\/p>\n<pre>&lt;input type=\"file\"\n       id=\"avatar\" name=\"avatar\"\n       accept=\"application\/vnd.ms-excel,application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text\/csv, .csv\"&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b64\u66f4\u6539\u5c06\u5141\u8bb8\u9009\u62e9\u6240\u6709\u5177\u6709\u6307\u5b9a MIME \u7c7b\u578b\u7684\u6587\u4ef6\u4ee5\u53ca\u5177\u6709 .csv \u6269\u5c55\u540d\u7684\u6587\u4ef6\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 input \u6587\u4ef6\u9009\u62e9\u5668\u4ec5\u5141\u8bb8\u9009\u62e9\u7279\u5b9a\u6587\u4ef6\u7c7b\u578b\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>input \u6587\u4ef6\u9009\u62e9\u5668\u8bbe\u7f6e mime \u7c7b\u578b\u95ee\u9898 \u95ee\u9898\uff1a \u5982\u4f55\u5728 input \u6587\u4ef6\u9009\u62e9\u5668\u4e2d\u8bbe\u7f6e MIME \u7c7b\u578b\uff0c\u4ec5\u5141\u8bb8\u9009\u62e9\u7279\u5b9a\u7684\u6587\u4ef6\u7c7b\u578b\uff08\u4f8b\u5982 xls\u3001xlsx \u548c csv\uff09\uff1f \u5177\u4f53\u95ee\u9898\uff1a \u867d\u7136\u5df2\u8bbe\u7f6e accept \u5c5e\u6027\uff0c\u4f46 csv \u6587\u4ef6\u7c7b\u578b\u4f3c\u4e4e\u65e0\u6cd5\u751f\u6548\u3002 \u4ee3\u7801\u793a\u4f8b\uff1a &lt;input type=&#8221;file&#8221; id=&#8221;avatar&#8221; name=&#8221;avatar&#8221; accept=&#8221;application\/vnd.ms-excel,application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text\/csv&#8221;&gt; \u767b\u5f55\u540e\u590d\u5236 \u8fd0\u884c\u622a\u56fe\uff1a ![\u6587\u4ef6\u9009\u62e9\u5668\u622a\u56fe\uff0c\u4ec5\u663e\u793a xls \u548c xlsx \u6587\u4ef6\u7c7b\u578b]** \u7b54\u6848\uff1a \u4e3a\u4e86\u4f7f csv \u6587\u4ef6\u7c7b\u578b\u751f\u6548\uff0c\u53ef\u4ee5\u6dfb\u52a0\u989d\u5916\u7684 accept \u503c\uff1a accept=&#8221;&#8230;, .csv&#8221; \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u662f\u56e0\u4e3a MIME \u7c7b\u578b\u53ea\u5339\u914d MIME \u7c7b\u578b\u524d\u9762\u7684\u6269\u5c55\u540d\uff0c\u800c\u4e0d\u4f1a\u5339\u914d\u6587\u4ef6\u6269\u5c55\u540d\u524d\u9762\u7684 MIME \u7c7b\u578b\u3002 \u4fee\u6539\u540e\u7684\u4ee3\u7801\uff1a &lt;input type=&#8221;file&#8221; id=&#8221;avatar&#8221; name=&#8221;avatar&#8221; accept=&#8221;application\/vnd.ms-excel,application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text\/csv, .csv&#8221;&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1662","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=1662"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1662\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}