{"id":11121,"date":"2021-05-09T21:48:30","date_gmt":"2021-05-09T12:48:30","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=11121"},"modified":"2021-05-09T21:52:39","modified_gmt":"2021-05-09T12:52:39","slug":"%ec%9b%b9%ec%97%90%ec%84%9c-binary-data%eb%a5%bc-%ed%8c%8c%ec%9d%bc%eb%a1%9c-%ec%a0%80%ec%9e%a5%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=11121","title":{"rendered":"\uc6f9\uc5d0\uc11c Binary Data\ub97c \ud30c\uc77c\ub85c \uc800\uc7a5\ud558\uae30"},"content":{"rendered":"<p>\uc6f9\uc5d0\uc11c ArrayBuffer\ub97c \ud30c\uc77c\ub85c \uc800\uc7a5\ud558\uae30 \uc704\ud55c \ucf54\ub4dc\uc5d0 \ub300\ud55c \ub0b4\uc6a9\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc6f9\uc5d0\uc11c\ub294 PC\uc5d0 \uc800\uc7a5\ub41c \ud30c\uc77c\uc744 \uc77d\uac70\ub098 \uc4f8\ub54c \ubc18\ub4dc\uc2dc \uc0ac\ub78c\uc758 \ud589\uc704\uac00 \uc218\ubc18\ub418\uc5b4\uc57c \ud569\ub2c8\ub2e4. \uc989, \ubc84\ud2bc\uacfc \uac19\uc740 UI\ub97c \uc0ac\ub78c\uc774 \uc758\ub3c4\ud558\uc5ec \ud074\ub9ad\uc744 \ud574\uc57c\ub9cc \ud55c\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 \ud544\uc694\ud55c UI\uc5d0 \ub300\ud55c DOM \uc694\uc18c\ub97c \uc544\ub798\ucc98\ub7fc \uc0dd\uc131\ud574 \ub461\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">\r\n&lt;button id=\"exportFile\">Export To File&lt;\/button>\r\n<\/pre>\n<p>\uadf8\ub9ac\uace0 \uc704\uc758 \ubc84\ud2bc\uc5d0 \ub300\ud55c \ud074\ub9ad \uc774\ubca4\ud2b8\uc5d0 \ub300\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc9c0\uc815\ud558\uad6c\uc694.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nconst exportButton = document.getElementById( 'exportFile' );\r\nexportButton.addEventListener( 'click', exportFile );\r\n<\/pre>\n<p>\uc704\uc758 exportFile \ud568\uc218\uc5d0 \ub300\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nfunction exportFile() {\r\n    const buffer = createData(); \/* ArrayBuffer \ud615\uc2dd\uc758 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud558\ub294 \ud568\uc218 *\/ \r\n    const blob = new Blob( [ buffer ], \r\n        { type: 'application\/octet-stream' } )\r\n    link.href = URL.createObjectURL( blob );\r\n    link.download = 'file.dat';\r\n    link.click();\r\n}\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\uc5d0\uc11c link\ub294 \ub2e4\uc74c\ucc98\ub7fc \ub3d9\uc801\uc73c\ub85c \uc0dd\uc131\ub41c a \ud14c\uadf8 \uc694\uc18c\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nconst link = document.createElement( 'a' );\r\nlink.style.display = 'none';\r\ndocument.body.appendChild( link );\r\n<\/pre>\n<p>\uacb0\uacfc\uc801\uc73c\ub85c \uc0ac\uc6a9\uc790\uac00 \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uba74 a Tag\uac00 \ud074\ub9ad\ud55c \uac83\uc73c\ub85c \ucc98\ub9ac\ub418\uc5b4 \ud30c\uc77c \uc800\uc7a5\uc774 \uc9c4\ud589\ub429\ub2c8\ub2e4.<\/p>\n<p>\uc5ec\uae30\uc11c \ucd94\uac00\ub85c \ub9cc\uc57d \uc800\uc7a5\ud558\uace0\uc790 \ud558\ub294 \ub370\uc774\ud130\uac00 \ubc14\uc774\ub108\ub9ac\uac00 \uc544\ub2cc \ud14d\uc2a4\ud2b8\ub77c\uba74 \uc704\uc758 \ucf54\ub4dc \uc911 \ubcc0\uacbd\ud574\uc57c\ud560 \ubd80\ubd84\uc740 \uc5b4\ub51c\uae4c\uc694? exportFile \ud568\uc218\uc5d0 \ub300\ud55c \ucf54\ub4dc \uc911 3,4\ubc88\uc758 buffer\uac00 \ub2e8\uc21c\ud55c \ubb38\uc790\uc5f4 \uac12\uc774\uba70 type: &#8216;text\/plain&#8217;\ub85c \uc9c0\uc815\ud574 \uc8fc\uba74 \ub429\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc6f9\uc5d0\uc11c ArrayBuffer\ub97c \ud30c\uc77c\ub85c \uc800\uc7a5\ud558\uae30 \uc704\ud55c \ucf54\ub4dc\uc5d0 \ub300\ud55c \ub0b4\uc6a9\uc785\ub2c8\ub2e4. \uc6f9\uc5d0\uc11c\ub294 PC\uc5d0 \uc800\uc7a5\ub41c \ud30c\uc77c\uc744 \uc77d\uac70\ub098 \uc4f8\ub54c \ubc18\ub4dc\uc2dc \uc0ac\ub78c\uc758 \ud589\uc704\uac00 \uc218\ubc18\ub418\uc5b4\uc57c \ud569\ub2c8\ub2e4. \uc989, \ubc84\ud2bc\uacfc \uac19\uc740 UI\ub97c \uc0ac\ub78c\uc774 \uc758\ub3c4\ud558\uc5ec \ud074\ub9ad\uc744 \ud574\uc57c\ub9cc \ud55c\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 \ud544\uc694\ud55c UI\uc5d0 \ub300\ud55c DOM \uc694\uc18c\ub97c \uc544\ub798\ucc98\ub7fc \uc0dd\uc131\ud574 \ub461\ub2c8\ub2e4. &lt;button id=&#8221;exportFile&#8221;>Export To File&lt;\/button> \uadf8\ub9ac\uace0 \uc704\uc758 \ubc84\ud2bc\uc5d0 \ub300\ud55c \ud074\ub9ad \uc774\ubca4\ud2b8\uc5d0 \ub300\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc9c0\uc815\ud558\uad6c\uc694. const &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=11121\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\uc6f9\uc5d0\uc11c Binary Data\ub97c \ud30c\uc77c\ub85c \uc800\uc7a5\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-11121","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11121"}],"version-history":[{"count":3,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11121\/revisions"}],"predecessor-version":[{"id":11124,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11121\/revisions\/11124"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11121"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}