{"id":652,"date":"2022-11-23T21:15:43","date_gmt":"2022-11-23T13:15:43","guid":{"rendered":"http:\/\/wordpress.loc\/?p=652"},"modified":"2022-11-23T21:16:17","modified_gmt":"2022-11-23T13:16:17","slug":"esp32_ch2-6","status":"publish","type":"post","link":"https:\/\/www.nmking.io\/index.php\/2022\/11\/23\/652\/","title":{"rendered":"ESP32-CAM \u81ea\u52d5\u62cd\u7167\u4e26\u4e0a\u50b3\u4f3a\u670d\u5668(http file post)"},"content":{"rendered":"\n<figure class=\"wp-block-pullquote\"><blockquote><p>\u9019\u6b21\u8981\u4ecb\u7d39\u5982\u4f55\u5c07\u7167\u7247\u4e0a\u50b3\u5230\u7279\u5b9a\u7684\u4f3a\u670d\u5668\uff0c\u672c\u7bc7\u6587\u7ae0\u4f7f\u7528\u4e0a\u50b3\u65b9\u5f0f\u662f\u76ee\u524d\u6700\u5e38\u7528\u7684http post<br>\u76f8\u7576\u591aAPI\u90fd\u4f7f\u7528\u9019\u985e\u65b9\u5f0f<\/p><\/blockquote><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-ht-block-toc is-style-rounded htoc htoc--position-wide toc-list-style-plain\" data-htoc-state=\"expanded\"><span class=\"htoc__title\"><span class=\"ht_toc_title\">Table of Contents<\/span><span class=\"htoc__toggle\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"16\" height=\"16\"><g fill=\"#444\"><path d=\"M15 7H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><path d=\"M15 1H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM15 13H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><\/g><\/svg><\/span><\/span><div class=\"htoc__itemswrap\"><ul class=\"ht_toc_list\"><li class=\"\"><a href=\"#htoc-\">\u5be6\u4f5c\u8aaa\u660e<\/a><\/li><li class=\"\"><a href=\"#htoc-esp32-cam\">\u4e00\u3001ESP32-CAM\u90e8\u4efd<\/a><\/li><li class=\"\"><a href=\"#htoc-1\">\u4e8c\u3001\u4f3a\u670d\u5668\u63a5\u6536\u7aef<\/a><\/li><\/ul><\/div><\/div>\n\n\n\n<p>\u6211\u7684ESP32\u5be6\u505a\u66f8\u7c4d\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/10\/esp32_ch1-2\/\" target=\"_blank\">\u6211\u51fa\u66f8\u4e86 ESP32 \u7269\u806f\u7db2\u5c08\u984c<\/a><br>\u535a\u5ba2\u4f86\u7db2\u5740\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.books.com.tw\/products\/0010901195\" target=\"_blank\">https:\/\/www.books.com.tw\/products\/0010901195<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-\">\u5be6\u4f5c\u8aaa\u660e<\/h2>\n\n\n\n<p>\u7e7c\u4e0a\u7bc7\uff1a<a href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/08\/esp32_ch2-3\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32-CAM(ardunio)\u62cd\u7167auto take picture\u3001\u4e32\u6d41stream\u53ca\u7269\u4ef6\u8fa8\u8b58object<\/a>\uff0c\u80fd\u62cd\u7167\u4e26\u5b58\u6a94\uff0c\u9019\u6b21\u8981\u4ecb\u7d39\u5982\u4f55\u5c07\u7167\u7247\u4e0a\u50b3\u5230\u7279\u5b9a\u7684\u4f3a\u670d\u5668\uff0c\u672c\u7bc7\u6587\u7ae0\u4f7f\u7528\u4e0a\u50b3\u65b9\u5f0f\u662f\u76ee\u524d\u6700\u5e38\u7528\u7684http post\uff0c\u76f8\u7576\u591aAPI\u90fd\u4f7f\u7528\u9019\u985e\u65b9\u5f0f\uff0c\u7576\u7136\u53e6\u5916\u6709\u5176\u4ed6\u65b9\u5f0f\u5f85\u4ee5\u5f8c\u5728\u4ecb\u7d39\u3002<\/p>\n\n\n\n<p>\u8981\u5b8c\u6210\u672c\u7bc7\u6587\u7ae0\uff0c\u8acb\u4f9d\u5e8f\u5b8c\u6210\u4ee5\u4e0b\u4e3b\u984c<\/p>\n\n\n\n<p>ESP32-CAM\u74b0\u5883\u5efa\u7acb\u8207\u7bc4\u4f8b\u6e2c\u8a66\uff1a <a href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/03\/esp32_ch2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Build a Video Stream Server by ESP32-CAM (arduino)\u5f71\u50cf\u4f3a\u670d\u5668\u53ca\u81c9\u90e8\u8fa8\u8b58<\/a><br>ESP32-CAM\u62cd\u7167\u53caSDcard\u5b58\u6a94\uff1a<a href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/08\/esp32_ch2-3\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32-CAM(ardunio)\u62cd\u7167auto take picture\u3001\u4e32\u6d41stream\u53ca\u7269\u4ef6\u8fa8\u8b58object<\/a><br><\/p>\n\n\n\n<p>\u5b8c\u6210\u4ee5\u4e0a\u6e2c\u8a66\u5f8c\uff0c\u5c31\u53ef\u4ee5\u9032\u884c\u4ee5\u4e0b\u5167\u5bb9\uff0c\u4ee5\u4e0b\u5167\u5bb9\u4e3b\u8981\u5206\u6210\u4e00\u3001ESP32-CAM\u7aef\u53ca\u4e8c\u3001\u4f3a\u670d\u5668\u63a5\u6536\u7aef\uff0cESP32-CAM\u62cd\u7167\u5f8c\uff0c\u5c07\u6a94\u6848\u4ee5HTTP POST\u65b9\u5f0f\u4e0a\u50b3\u5230\u4f3a\u670d\u5668\uff0c\u56e0\u6b64\u4f60\u5fc5\u9808\u6e96\u5099\u4e00\u53f0\u96fb\u8166\u4e26\u5b89\u88ddweb\u670d\u52d9\uff0c\u4ee5\u4e0b\u5206\u5225\u4ecb\u7d39<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1561314813-4191064496_n.png?resize=840%2C361&#038;ssl=1\" alt=\"\" width=\"840\" height=\"361\"\/><figcaption class=\"wp-element-caption\">\u64cd\u4f5c\u6d41\u7a0b<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-esp32-cam\">\u4e00\u3001ESP32-CAM\u90e8\u4efd<\/h2>\n\n\n\n<p>ESP32-CAM\u4e3b\u8981\u9032\u884c\u62cd\u7167\u5b58\u6a94\u4e26\u4e0a\u50b3\uff0c\u62cd\u7167\u53ef\u5b9a\u6642\u62cd\u7167\uff0c\u6216\u50cf\u300c<a href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/08\/esp32_ch2-3\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32-CAM(ardunio)\u62cd\u7167auto take picture\u3001\u4e32\u6d41stream\u53ca\u7269\u4ef6\u8fa8\u8b58object<\/a>\u300d\u4ee5\u4eba\u9ad4\u611f\u6e2c\u9032\u884c\u62cd\u7167\uff0c\u672c\u7bc4\u4f8b\u7c21\u55ae\u8d77\u898b\uff0c\u63a1\u7528\u6bcf30\u79d2\u5b9a\u6642\u62cd\u7167\u3002\u7bc4\u4f8b\u7a0b\u5f0f\u653e\u5728\u672c\u7bc7\u6700\u5f8c\u65b9\uff0c\u8acb\u6ce8\u610f\uff0c\u9808\u4fee\u6539\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n\n\n\n<p>\u7b2c66-67\uff0c\u8acb\u4fee\u6539\u6210\u81ea\u5df1\u7684wifi\u8a2d\u5b9a\u7684SSID\u8207\u5bc6\u78bc<br>\u7b2c68-69\uff0c\u8acb\u4fee\u6539\u6210\u81ea\u5df1\u7684web server\u7684IP(\u6216DNS)\u8207\u63a5\u6536\u7167\u7247\u7684html\u6a94\u6848\u7684URL\u3002<br>loop\uff081211-1220\uff09\u5340\u584a\u4e2d\uff0c\u76ee\u524d\u4ee530s\u81ea\u52d5\u62cd\u7167\uff0c\u82e5\u6709\u9700\u8981\u53ef\u4ee5\u522a\u9664\u7b2c1213\u53ca1219\u7684if\u5340\u584a\u8a3b\u89e3\u3002<br>\u672c\u6587\u4e3b\u8981\u591a\u4e86\u4e00\u96bb\u526f\u7a0b\u5f0f\u300cwifisendfile\u300d\u9032\u884c\u6a94\u6848\u4e0a\u50b3\uff0cwifisendfile\u9700\u8981\u4e09\u500b\u53c3\u6578\uff0c\u5206\u5225\u662f\u6a94\u6848\u4f4d\u7f6e\u8207\u540d\u7a31\u3001\u4e0a\u50b3\u4f3a\u670d\u5668IP\u4ee5\u53ca\u63a5\u6536\u7167\u7247\u7684HTML\u6a94\u6848\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-1\">\u4e8c\u3001\u4f3a\u670d\u5668\u63a5\u6536\u7aef<\/h2>\n\n\n\n<p>\u4f3a\u670d\u5668\u7684\u5be6\u505a\uff0c\u6709\u5f88\u591a\u9078\u64c7\uff0c\u53ef\u4ee5\u7528linux+PHP\u6216\u8005windows+IIS+APS.net\u7b49\u7b49\uff0c\u7531\u65bc\u672c\u4eba\u6bd4\u8f03\u719f\u6089.net\u5e73\u53f0\uff0c\u56e0\u6b64\u4ee5\u4e0b\u4ecb\u7d39\u5982\u4f55\u5229\u7528asp.net\u4f86\u63a5\u6536ARDUINO\u50b3\u4f86\u7684\u6a94\u6848\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u96fb\u8166\u5fc5\u9808\u5b89\u88ddIIS\u6216IIS express\uff0c\u5b89\u88dd\u6d41\u7a0b\u53ef\u53c3\u95b1\uff1a <a href=\"http:\/\/charlesbc.blogspot.com\/2011\/01\/iis-express_16.html\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/charlesbc.blogspot.com\/2011\/01\/iis-express_16.html<\/a><br>.net\u5b89\u88dd\u958b\u767c\u74b0\u5883\uff0c\u76ee\u524d\u5305\u62ecVS.net 2017\u62162019\uff0c\u90fd\u6709\u793e\u7fa4\u514d\u8cbb\u7248\u53ef\u4ee5\u9078\u64c7\uff0c\u4e0b\u8f09\u7db2\u5740\uff1a <a href=\"https:\/\/visualstudio.microsoft.com\/zh-hant\/downloads\/?utm_medium=microsoft&amp;utm_source=docs.microsoft.com&amp;utm_campaign=button+cta&amp;utm_content=download+vs2019&amp;rr=https%3A%2F%2Fdocs.microsoft.com%2Fzh-tw%2Fvisualstudio%2Finstall%2Finstall-visual-studio%3Fview%3Dvs-2019\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/visualstudio.microsoft.com\/zh-hant\/downloads\/?utm_medium=microsoft&amp;utm_source=docs.microsoft.com&amp;utm_campaign=button+cta&amp;utm_content=download+vs2019&amp;rr=https%3A%2F%2Fdocs.microsoft.com%2Fzh-tw%2Fvisualstudio%2Finstall%2Finstall-visual-studio%3Fview%3Dvs-2019<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1561316711-2510201273_n.png?resize=841%2C472&#038;ssl=1\" alt=\"\" width=\"841\" height=\"472\"\/><figcaption class=\"wp-element-caption\">Visual Studio \u793e\u7fa4\u514d\u8cbb\u7248\u4e0b\u8f09<\/figcaption><\/figure>\n\n\n\n<p>\u5b89\u88dd\u6642\uff0c\u8acb\u81f3\u5c11\u9078\u64c7\u4ee5\u4e0b\u5e7e\u500b\u6a21\u7d44\uff0c\u5176\u9918\u60a8\u81ea\u884c\u659f\u914c\u662f\u5426\u9700\u8981\u5b89\u88dd\uff0cVS.net\u662f\u4e00\u500b\u5b87\u5b99\u6700\u80a5\u6c92\u6709\u4e4b\u4e00\u7684\u958b\u767c\u5e73\u53f0\uff0c\u5b89\u88dd\u6642\u8acb\u6ce8\u610f\u81ea\u5df1\u7684\u786c\u789f\u7a7a\u9593<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1561361845-891126996_n.png?resize=840%2C591&#038;ssl=1\" alt=\"\" width=\"840\" height=\"591\"\/><figcaption class=\"wp-element-caption\">\u9078\u64c7VS.net<\/figcaption><\/figure>\n\n\n\n<p>\u5b8c\u6210\u5b89\u88dd\u5f8c\uff0c\u555f\u52d5VS.net\u4e3b\u7a0b\u5f0f\uff0c\u4e26\u958b\u555f\u672c\u5730\u7aefIIS\u7ad9\uff0c\u5c31\u53ef\u9032\u884c\u4e0b\u4e00\u6b65\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1561362485-3957084217_n.png?resize=841%2C421&#038;ssl=1\" alt=\"\" width=\"841\" height=\"421\"\/><figcaption class=\"wp-element-caption\">\u555f\u52d5VS.net\u4e3b\u7a0b\u5f0f<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1561362727-488268961.png?resize=837%2C539&#038;ssl=1\" alt=\"\" width=\"837\" height=\"539\"\/><figcaption class=\"wp-element-caption\">\u958b\u555f\u672c\u5730\u7aefIIS\u7ad9<\/figcaption><\/figure>\n\n\n\n<p>ASP\u6a94\u6848\u63a5\u6536\u7684\u7a0b\u5f0f\u90e8\u4efd\uff0c\u7531\u65bc\u672c\u4eba\u5df2\u7d93\u662fold school\u4e86\uff0c\u5c31\u4ee5\u6700\u64c5\u9577\u7684vb.net\u5beb\u7bc4\u4f8b\u7a0b\u5f0f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    Private Sub default_Load(sender As Object, e As EventArgs) Handles Me.Load\n        '0\u6a94\u6848\u4e0a\u50b3\u8655\u7406\n        Dim aFile As HttpFileCollection = Request.Files\n        If aFile.Count > 0 Then\n            Dim relativePath As String = \"files\\\"\n            Dim absolutePath As String = Server.MapPath(\"~\/\" + relativePath)\n            Dim displayFileName As String = Path.GetFileName(aFile(0).FileName)\n            Dim filename As String = Int(Now().Ticks) &amp; \".jpg\"\n            Dim realFileName As String = absolutePath &amp; filename\n            aFile(0).SaveAs(realFileName) \n        End If\n    End Sub<\/code><\/pre>\n\n\n\n<p>\u6a94\u6848\u4e0a\u50b3\u5f8c\uff0c\u6703\u5b58\u5728\u4f3a\u670d\u5668\u4e2d\uff0c\u5c31\u53ef\u4ee5\u7528\u4f86\u505a\u5f88\u591a\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u8f49\u5b58\u5230azure\u505a\u667a\u6167\u8fa8\u8b58\u3001\u9001\u5230LINE\u88e1\u9762\u505a\u901a\u77e5\u7b49\u7b49\u3002<br>\u4e0d\u904e\u5462\uff0c\u4e00\u6b21\u6a94\u6848\u7684POST\uff0c\u9700\u8981\u5927\u69825\u79d2\u9418\u6642\u9593\uff0c\u56e0\u6b64\u4e0d\u9069\u5408\u7528\u4f86\u505a\u5373\u6642\u5316\u7684\u670d\u52d9\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1561317406-1227324902.png?resize=839%2C553&#038;ssl=1\" alt=\"\" width=\"839\" height=\"553\"\/><figcaption class=\"wp-element-caption\">\u6a94\u6848\u5132\u5b58\u756b\u9762<\/figcaption><\/figure>\n\n\n\n<script src=\"https:\/\/gist.github.com\/youjunjer\/c2068b70f124ee657ef5561cc01902e6.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u6b21\u8981\u4ecb\u7d39\u5982\u4f55\u5c07\u7167\u7247\u4e0a\u50b3\u5230\u7279\u5b9a\u7684\u4f3a\u670d\u5668\uff0c\u672c\u7bc7\u6587\u7ae0\u4f7f\u7528\u4e0a\u50b3\u65b9\u5f0f\u662f\u76ee\u524d\u6700\u5e38\u7528\u7684http post\u76f8\u7576\u591aAPI\u90fd\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,26],"tags":[],"class_list":["post-652","post","type-post","status-publish","format-standard","hentry","category-esp32","category-esp32cam"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/comments?post=652"}],"version-history":[{"count":1,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/652\/revisions"}],"predecessor-version":[{"id":653,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/652\/revisions\/653"}],"wp:attachment":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/media?parent=652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/categories?post=652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/tags?post=652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}