{"id":8616,"date":"2024-01-19T17:54:00","date_gmt":"2024-01-19T17:54:00","guid":{"rendered":"https:\/\/codehim.com\/?p=8616"},"modified":"2024-01-22T15:55:05","modified_gmt":"2024-01-22T10:55:05","slug":"javascript-compress-image-before-upload","status":"publish","type":"post","link":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/","title":{"rendered":"JavaScript Compress Image Before Upload"},"content":{"rendered":"<p>This JavaScript code helps you to compress image size before upload to server. It calculates and displays the original image size in MB when you choose an image. Then, it displays the image, compresses it into WebP format, and reveals the new compressed size in KB. This code is handy for making your web pages load faster by reducing image sizes before uploading them.<\/p>\n<h2>How to Compress Image Size Before Upload using JavaScript<\/h2>\n<p>1. Include the following HTML structure in your webpage. This code assumes you have an input field for selecting an image, a display area for the image before compression, and a display area for the image after compression.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;input type=\"file\" name=\"upload-image\" id=\"upload-image\" required \/&gt;\r\n&lt;h2&gt; Before &lt;\/h2&gt;\r\n&lt;p name=\"before-compression\"&gt;&lt;\/p&gt;\r\n&lt;img src=\"\" class=\"before\" style=\"display:none;\"\/&gt;\r\n&lt;canvas style=\"display: none;\"&gt;&lt;\/canvas&gt;\r\n&lt;h2&gt; After &lt;\/h2&gt;\r\n&lt;p name=\"after-compression\"&gt;&lt;\/p&gt;\r\n&lt;img src=\"\" class=\"after\" style=\"display:none;\"\/&gt;\r\n<\/pre>\n<p>2. You can customize the CSS styles to match your website&#8217;s design, but the following code includes basic styling for the elements. Adjust it as needed.<\/p>\n<pre class=\"prettyprint linenums lang-css\">#upload-image{\r\n   display: block;\r\n}\r\n.before, .after{\r\n  max-width: 640px;\r\n}<\/pre>\n<p>3. Copy and paste the JavaScript code into your webpage. This code handles the image compression process.<\/p>\n<pre class=\"prettyprint linenums lang-js\">const ReadAndCompress = (e) =&gt; {\r\n  const size = `Before Compression: ${(e.target.files[0].size\/(1000*1024)).toFixed(2)} MB`;\r\n  document.querySelector(\"p[name=before-compression]\").innerHTML = size;\r\n  const reader = new FileReader();\r\n  reader.readAsDataURL(e.target.files[0]);\r\n\r\n  reader.onload = event =&gt; {\r\n    const img = document.querySelector(\"img.before\");\r\n    img.src = event.target.result;\r\n    img.style = \"display: block\";\r\n    img.onload = () =&gt; {\r\n      const width = img.width;\r\n      const height = img.height;\r\n      const elem = document.querySelector('canvas');\r\n      elem.width = width;\r\n      elem.height = height;\r\n      const ctx = elem.getContext('2d');\r\n      ctx.drawImage(img, 0, 0, width, height);\r\n      const webp = ctx.canvas.toDataURL(\"image\/webp\", 0.5);\r\n      const imgAfter = document.querySelector(\"img.after\");\r\n      imgAfter.src = webp;\r\n      imgAfter.style = \"display: block\";\r\n      const head = 'data:image\/webp;base64,';\r\n      const imgFileSize = (Math.round((webp.length - head.length)*3\/4) \/ (1000)).toFixed(2);\r\n      document.querySelector(\"p[name=after-compression]\").innerHTML =\r\n        `After Compression: ${imgFileSize} KB`;\r\n    },\r\n    reader.onerror = error =&gt; console.error(error);\r\n  }\r\n}\r\n\r\ndocument.querySelector(\"input[name=upload-image]\")\r\n.addEventListener(\"change\", (event) =&gt; ReadAndCompress(event))<\/pre>\n<p>4. To upload the compressed image that is shown as output, you can modify the provided code by adding a function to send the compressed image to your server or a cloud storage service. Here&#8217;s a general outline of how you can do it:<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;input type=\"file\" name=\"upload-compressed-image\" id=\"upload-compressed-image\" required \/&gt;\r\n&lt;button id=\"upload-button\"&gt;Upload Compressed Image&lt;\/button&gt;\r\n<\/pre>\n<p>5. Add an event listener to the new upload button or form to trigger the upload process. You can use the Fetch API or any other method to send the compressed image to your server.<\/p>\n<pre class=\"prettyprint linenums lang-js\">document.querySelector(\"#upload-button\").addEventListener(\"click\", () =&gt; {\r\nconst compressedImage = document.querySelector(\"img.after\").src;\r\nuploadCompressedImage(compressedImage);\r\n});\r\n\r\nfunction uploadCompressedImage(compressedImage) {\r\n\/\/ Use the Fetch API or another method to send 'compressedImage' to your server.\r\n\/\/ You may need to handle server-side processing and storage of the uploaded image.\r\n}\r\n<\/pre>\n<p>Remember that the server-side handling part will depend on your backend technology stack. The code provided here outlines the client-side modifications to initiate the upload process.<\/p>\n<p>That&#8217;s all! hopefully, you have successfully created a feature to compress Image size Before Upload. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This JavaScript code helps you to compress image size before upload to server. It calculates and displays the original image&#8230;<\/p>\n","protected":false},"author":1,"featured_media":8626,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[116],"tags":[],"class_list":["post-8616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vanilla-javascript"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript Compress Image Before Upload &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a JavaScript Compress Image Before Upload. You can view demo and download the source code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Compress Image Before Upload &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a JavaScript Compress Image Before Upload. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-19T17:54:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T10:55:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"JavaScript Compress Image Before Upload\",\"datePublished\":\"2024-01-19T17:54:00+00:00\",\"dateModified\":\"2024-01-22T10:55:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/\"},\"wordCount\":289,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png\",\"articleSection\":[\"Vanilla JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/\",\"url\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/\",\"name\":\"JavaScript Compress Image Before Upload &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png\",\"datePublished\":\"2024-01-19T17:54:00+00:00\",\"dateModified\":\"2024-01-22T10:55:05+00:00\",\"description\":\"Here is a free code snippet to create a JavaScript Compress Image Before Upload. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png\",\"width\":1280,\"height\":960,\"caption\":\"JavaScript Compress Image Before Upload\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vanilla JavaScript\",\"item\":\"https:\/\/codehim.com\/category\/vanilla-javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Compress Image Before Upload\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Compress Image Before Upload &#8212; CodeHim","description":"Here is a free code snippet to create a JavaScript Compress Image Before Upload. You can view demo and download the source code.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Compress Image Before Upload &#8212; CodeHim","og_description":"Here is a free code snippet to create a JavaScript Compress Image Before Upload. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-19T17:54:00+00:00","article_modified_time":"2024-01-22T10:55:05+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"JavaScript Compress Image Before Upload","datePublished":"2024-01-19T17:54:00+00:00","dateModified":"2024-01-22T10:55:05+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/"},"wordCount":289,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png","articleSection":["Vanilla JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/","url":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/","name":"JavaScript Compress Image Before Upload &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png","datePublished":"2024-01-19T17:54:00+00:00","dateModified":"2024-01-22T10:55:05+00:00","description":"Here is a free code snippet to create a JavaScript Compress Image Before Upload. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/09\/JavaScript-Compress-Image-Before-Upload.png","width":1280,"height":960,"caption":"JavaScript Compress Image Before Upload"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-compress-image-before-upload\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Vanilla JavaScript","item":"https:\/\/codehim.com\/category\/vanilla-javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript Compress Image Before Upload"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":1347,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/8616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=8616"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/8616\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/8626"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=8616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=8616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=8616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}