{"id":2964,"date":"2019-08-30T21:26:05","date_gmt":"2019-08-30T21:26:05","guid":{"rendered":"https:\/\/ionicframework.com\/blog\/?p=2964"},"modified":"2020-01-23T16:12:35","modified_gmt":"2020-01-23T16:12:35","slug":"storing-photos-with-the-cordova-camera-and-file-plugins","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins","title":{"rendered":"Storing Photos with the Cordova Camera and File Plugins"},"content":{"rendered":"<p>Storing photos in a Cordova-based Ionic app can be challenging. Several concepts and layers of the app development stack are involved, including selecting the best Camera plugin configuration, saving files to permanent storage, and understanding how to render an image in a WebView.<\/p>\n<p>In this post, we\u2019ll use the <a href=\"https:\/\/ionicframework.com\/docs\/native\/camera\">Ionic Native Camera plugin<\/a> to take photos, then save them to the app\u2019s filesystem using the <a href=\"https:\/\/ionicframework.com\/docs\/native\/file\">Ionic Native File plugin<\/a>.<\/p>\n<blockquote><p>\n  Note: For a guide covering similar concepts using Capacitor&#8217;s Camera and File plugins, see Josh Morony\u2019s great guide <a href=\"https:\/\/www.joshmorony.com\/using-the-capacitor-filesystem-api-to-store-photos\/\">here<\/a>. For more advanced Cordova examples covering images, video, and audio, see Simon Grimm&#8217;s <a href=\"https:\/\/devdactic.com\/ionic-4-media-files-guide\/\">Ionic Media Files guide<\/a>.\n<\/p><\/blockquote>\n<p><!--more--><\/p>\n<h2>Plugin Installation<\/h2>\n<p>First, install the two native plugins into your Ionic project:<\/p>\n<pre><code class=\"language-shell\"># Camera plugin\nionic cordova plugin add cordova-plugin-camera\nnpm install @ionic-native\/camera\n\n# File plugin\nionic cordova plugin add cordova-plugin-file\nnpm install @ionic-native\/file\n<\/code><\/pre>\n<h2>Camera Plugin: Configuration and Capturing Photos<\/h2>\n<p>With both plugins installed, we can now configure the camera options. We use <code>FILE_URI<\/code> as the destination type to save the captured image to temporary file storage. Avoid <code>DATA_URL<\/code>, which returns the image as a base64 encoded string, because loading image data into a string is very memory intensive, often leading to app crashes.<\/p>\n<pre><code class=\"language-javascript\">const options: CameraOptions = {\n  quality: 100,\n  destinationType: this.camera.DestinationType.FILE_URI,\n  encodingType: this.camera.EncodingType.JPEG\n}\n<\/code><\/pre>\n<p>Next, call the <code>getPicture<\/code> method to open the camera on the device. Once the app user takes a photo and confirms it should be used, the path to the newly created image is stored in the <code>tempImage<\/code> variable.<\/p>\n<pre><code class=\"language-javascript\">const tempImage = await this.camera.getPicture(options);\n<\/code><\/pre>\n<h2>Saving Photos to the Filesystem<\/h2>\n<p>As we see, using the Camera plugin to take a photo is straightforward. Saving them permanently to the filesystem, however, gets tricky fast. Why do we need to use the filesystem plugin to store photos anyway? It turns out that images captured by the Camera plugin are only stored in the app\u2019s temporary storage. This keeps memory usage low, which is important of course on mobile devices, as well as useful when implementing features like letting the user preview the photo before storing it. However, this means that when the app is closed, the images will be deleted by the mobile OS.<\/p>\n<p>As part of the following code, I\u2019ll show examples of the filesystem values (all for iOS, though Android will look very similar) that each variable represents for each step of the photo saving implementation. It\u2019s helpful to see these values when debugging code that uses the File plugin. Here\u2019s an example value of <code>tempImage<\/code>:<\/p>\n<pre><code>file:\/\/\/var\/mobile\/Containers\/Data\/Application\/E4A79B4A-E5CB-4E0C-A7D9-0603ECD48690\/tmp\/cdv_photo_003.jpg\n<\/code><\/pre>\n<p>Let\u2019s review each portion of the filepath:<\/p>\n<ul>\n<li><code>file:\/\/\/<\/code>: The file protocol, which indicates that this is a file on the device.<\/li>\n<li><code>E4A79B4A-E5CB-4E0C-A7D9-0603ECD48690<\/code>: This is the app\u2019s unique id (GUID). Yours will be different than mine.<\/li>\n<li><code>\/tmp\/<\/code>: The temp directory within <em>this<\/em> app.<\/li>\n<li><code>cdv_photo_003.jpg<\/code>: The filename of the photo.<\/li>\n<\/ul>\n<p>Next, let\u2019s save the photo to the filesystem, beginning with extracting different pieces of the temp image filepath, so we can work with the File plugin.<\/p>\n<pre><code class=\"language-javascript\">\/\/ Extract just the filename. Result example: cdv_photo_003.jpg\nconst tempFilename = tempImage.substr(tempImage.lastIndexOf(&#039;\/&#039;) + 1);\n\n\/\/ Now, the opposite. Extract the full path, minus filename. \n\/\/ Result example: file:\/\/\/var\/mobile\/Containers\/Data\/Application\n\/\/ \/E4A79B4A-E5CB-4E0C-A7D9-0603ECD48690\/tmp\/\nconst tempBaseFilesystemPath = tempImage.substr(0, tempImage.lastIndexOf(&#039;\/&#039;) + 1);\n\n\/\/ Get the Data directory on the device. \n\/\/ Result example: file:\/\/\/var\/mobile\/Containers\/Data\/Application\n\/\/ \/E4A79B4A-E5CB-4E0C-A7D9-0603ECD48690\/Library\/NoCloud\/\nconst newBaseFilesystemPath = this.file.dataDirectory;\n<\/code><\/pre>\n<p>Next, save the photo to the filesystem by copying it from temp storage to permanent file storage, while maintaining the original filename. There are other methods available to save files, but this is the simplest. Notice that after saving the file, the photo is now found under the <code>Library\/NoCloud\/<\/code> directory instead of <code>tmp\/<\/code>.<\/p>\n<pre><code class=\"language-javascript\">await this.file.copyFile(tempBaseFilesystemPath, tempFilename, \n                         newBaseFilesystemPath, tempFilename);\n\n\/\/ Result example: file:\/\/\/var\/mobile\/Containers\/Data\/Application\n\/\/ \/E4A79B4A-E5CB-4E0C-A7D9-0603ECD48690\/Library\/NoCloud\/cdv_photo_003.jpg\nconst storedPhoto = newBaseFilesystemPath + tempFilename;\n<\/code><\/pre>\n<h2>Rendering the Photo<\/h2>\n<p>With the image now stored into the filesystem, you\u2019ll likely want to display it in the same app. There\u2019s a not-so-obvious snag, though: Cordova and Capacitor apps are hosted on a local HTTP server and are served with the <code>http:\/\/<\/code> protocol. As you\u2019ll recall however, files are \u201chosted\u201d using the <code>file:\/\/<\/code> protocol, so we must rewrite the image from a device filepath to the local HTTP server by using the <a href=\"https:\/\/ionicframework.com\/docs\/building\/webview#file-protocol\">Ionic Native WebView-provided<\/a> <code>convertFileSrc( )<\/code> method.<\/p>\n<pre><code class=\"language-javascript\">const displayImage = this.webview.convertFileSrc(storedPhoto);\n<\/code><\/pre>\n<p>Then, render the image using an Ionic <code>ion-image<\/code> component.<\/p>\n<pre><code class=\"language-html\">&lt;ion-img src=&quot;{{ displayImage }}&quot;\n<\/code><\/pre>\n<p>Here\u2019s the complete example:<\/p>\n<pre><code class=\"language-javascript\">const options: CameraOptions = {\n  quality: 100,\n  destinationType: this.camera.DestinationType.FILE_URI,\n  encodingType: this.camera.EncodingType.JPEG\n}\n\nconst tempImage = await this.camera.getPicture(options);\nconst tempFilename = tempImage.substr(tempImage.lastIndexOf(&#039;\/&#039;) + 1);\nconst tempBaseFilesystemPath = tempImage.substr(0, tempImage.lastIndexOf(&#039;\/&#039;) + 1);\n\nconst newBaseFilesystemPath = this.file.dataDirectory;\n\nawait this.file.copyFile(tempBaseFilesystemPath, tempFilename, \n                         newBaseFilesystemPath, tempFilename);\n\nconst storedPhoto = newBaseFilesystemPath + tempFilename;\nconst displayImage = this.webview.convertFileSrc(storedPhoto);\n<\/code><\/pre>\n<h3>Angular URL Sanitization<\/h3>\n<p>When using Angular, an extra step is required if using <a href=\"https:\/\/angular.io\/guide\/template-syntax#property-binding-property\">property data-binding<\/a>. If an image won&#8217;t render, it&#8217;s likely being blocked. In the DevTools console, an error will appear mentioning unsafe\/unsupported URLs.<\/p>\n<p>We know our images are safe, so address this by using <code>webview.convertFileSrc( )<\/code> as above, then the DOMSanitizer <code>bypassSecurityTrustUrl<\/code> function too:<\/p>\n<pre><code class=\"language-javascript\">import { DomSanitizer } from &#039;@angular\/platform-browser&#039;;\n\nconst resolvedImg = this.webview.convertFileSrc(storedPhoto);\nconst safeImg = this.sanitizer.bypassSecurityTrustUrl(resolvedImg);\n<\/code><\/pre>\n<p>The HTML template looks like:<\/p>\n<pre><code class=\"language-html\">&lt;img [src]=&quot;safeImg&quot; \/&gt;\n<\/code><\/pre>\n<p>With a bit of understanding of how the Cordova File plugin works, we\u2019re able to store photos properly in an Ionic app.<\/p>\n<h2>More Resources to Check Out<\/h2>\n<p>To see both Cordova and Capacitor versions of this tutorial&#8217;s code, check out the <a href=\"https:\/\/github.com\/ionic-team\/webinar-capflow\">demo app<\/a> referenced during our recent <a href=\"https:\/\/www.youtube.com\/watch?v=tkgNuSG5FJQ\">\u201cBuilding Capacitor Apps in Ionic Appflow\u201d webinar<\/a>.<\/p>\n<p>You can continue to explore the Camera and File plugins in both Simon\u2019s <a href=\"https:\/\/devdactic.com\/ionic-4-image-upload-storage\/\">Ionic 4 Images Guide<\/a> and Josh\u2019s <a href=\"https:\/\/www.joshmorony.com\/using-the-capacitor-filesystem-api-to-store-photos\/\">Using the Capacitor Filesystem API to Store Photos<\/a> guide.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Storing photos in a Cordova-based Ionic app can be challenging. Several concepts and layers of the app development stack are involved, including selecting the best Camera plugin configuration, saving files to permanent storage, and understanding how to render an image in a WebView. In this post, we\u2019ll use the Ionic Native Camera plugin to take [&hellip;]<\/p>\n","protected":false},"author":62,"featured_media":2965,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"","publish_post_category":"","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"","discourse_permalink":"","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[124],"tags":[28],"class_list":["post-2964","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-cordova"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Storing Photos with the Cordova Camera and File Plugins - Ionic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Storing Photos with the Cordova Camera and File Plugins\" \/>\n<meta property=\"og:description\" content=\"Storing photos in a Cordova-based Ionic app can be challenging. Several concepts and layers of the app development stack are involved, including selecting the best Camera plugin configuration, saving files to permanent storage, and understanding how to render an image in a WebView. In this post, we\u2019ll use the Ionic Native Camera plugin to take [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-30T21:26:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-23T16:12:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos-1024x563.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Matt Netkow\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dotNetkow\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matt Netkow\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins\"},\"author\":{\"name\":\"Matt Netkow\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/93c8b2fe110f183510c6285b0de40790\"},\"headline\":\"Storing Photos with the Cordova Camera and File Plugins\",\"datePublished\":\"2019-08-30T21:26:05+00:00\",\"dateModified\":\"2020-01-23T16:12:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins\"},\"wordCount\":750,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png\",\"keywords\":[\"Cordova\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins\",\"url\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins\",\"name\":\"Storing Photos with the Cordova Camera and File Plugins - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png\",\"datePublished\":\"2019-08-30T21:26:05+00:00\",\"dateModified\":\"2020-01-23T16:12:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png\",\"width\":1600,\"height\":880},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Storing Photos with the Cordova Camera and File Plugins\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/93c8b2fe110f183510c6285b0de40790\",\"name\":\"Matt Netkow\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/07\/mattnetkow-150x150.jpg\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/07\/mattnetkow-150x150.jpg\",\"caption\":\"Matt Netkow\"},\"sameAs\":[\"https:\/\/x.com\/dotNetkow\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/mattnetkow\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Storing Photos with the Cordova Camera and File Plugins - Ionic Blog","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:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins","og_locale":"en_US","og_type":"article","og_title":"Storing Photos with the Cordova Camera and File Plugins","og_description":"Storing photos in a Cordova-based Ionic app can be challenging. Several concepts and layers of the app development stack are involved, including selecting the best Camera plugin configuration, saving files to permanent storage, and understanding how to render an image in a WebView. In this post, we\u2019ll use the Ionic Native Camera plugin to take [&hellip;]","og_url":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins","og_site_name":"Ionic Blog","article_published_time":"2019-08-30T21:26:05+00:00","article_modified_time":"2020-01-23T16:12:35+00:00","og_image":[{"width":1024,"height":563,"url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos-1024x563.png","type":"image\/png"}],"author":"Matt Netkow","twitter_card":"summary_large_image","twitter_creator":"@dotNetkow","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Matt Netkow","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins"},"author":{"name":"Matt Netkow","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/93c8b2fe110f183510c6285b0de40790"},"headline":"Storing Photos with the Cordova Camera and File Plugins","datePublished":"2019-08-30T21:26:05+00:00","dateModified":"2020-01-23T16:12:35+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins"},"wordCount":750,"commentCount":0,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"image":{"@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png","keywords":["Cordova"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins","url":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins","name":"Storing Photos with the Cordova Camera and File Plugins - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage"},"image":{"@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png","datePublished":"2019-08-30T21:26:05+00:00","dateModified":"2020-01-23T16:12:35+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#primaryimage","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png","width":1600,"height":880},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/storing-photos-with-the-cordova-camera-and-file-plugins#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Storing Photos with the Cordova Camera and File Plugins"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/93c8b2fe110f183510c6285b0de40790","name":"Matt Netkow","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/07\/mattnetkow-150x150.jpg","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/07\/mattnetkow-150x150.jpg","caption":"Matt Netkow"},"sameAs":["https:\/\/x.com\/dotNetkow"],"url":"https:\/\/ionic.io\/blog\/author\/mattnetkow"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/08\/storing-photos.png","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/2964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=2964"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/2964\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media\/2965"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=2964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=2964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=2964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}