{"id":877,"date":"2020-06-29T16:13:05","date_gmt":"2020-06-29T08:13:05","guid":{"rendered":"https:\/\/www.yohz.com\/blogs\/?p=877"},"modified":"2020-06-29T16:13:05","modified_gmt":"2020-06-29T08:13:05","slug":"sql-image-viewer-post-processing-option","status":"publish","type":"post","link":"https:\/\/www.yohz.com\/blogs\/2020\/06\/29\/sql-image-viewer-post-processing-option\/","title":{"rendered":"SQL Image Viewer post processing option"},"content":{"rendered":"<p>In <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> 9.10, we added an option to allow you to run an application on each exported file.\u00a0 So say your database contained zip archives, and you use <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> to export those zip archives to disk.\u00a0 Using the post processing option, you can then use your favorite archiver to extract the files from the zip archives.<\/p>\n<p>The post processing option is only available when you choose the <strong>Export images and files<\/strong> option.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-878\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess01.png\" alt=\"\" width=\"628\" height=\"175\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess01.png 628w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess01-300x84.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess01-624x174.png 624w\" sizes=\"(max-width: 628px) 100vw, 628px\" \/><\/p>\n<p>In the export wizard, you will find the option on the <strong>Log, Email, and Post-processing Options<\/strong> page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-880\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess02-1.png\" alt=\"\" width=\"706\" height=\"613\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess02-1.png 706w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess02-1-300x260.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess02-1-624x542.png 624w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/p>\n<p>In this example, we will be using the 7zip command-line interface to extract the contents of our zip files.\u00a0 The <span style=\"text-decoration: underline;\"><strong>most important thing<\/strong> <\/span>to note here is that whichever application you use, it needs to complete regardless of its execution status.<\/p>\n<p>For example, in 7zip, if a file of the same name already exists, it will prompt you to overwrite or skip the file extraction.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-881\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess03.png\" alt=\"\" width=\"589\" height=\"263\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess03.png 589w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess03-300x134.png 300w\" sizes=\"(max-width: 589px) 100vw, 589px\" \/><\/p>\n<p>You cannot allow this to happen when running the application from within <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a>, because you cannot respond to the application from within <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a>, and thus will block the export process.<\/p>\n<p>To prevent this in our example, we use the -aoa flag to choose to always overwrite any existing files.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-882\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess04.png\" alt=\"\" width=\"706\" height=\"162\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess04.png 706w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess04-300x69.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess04-624x143.png 624w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/p>\n<p>So to run your application, enter the fully qualified name to its executable file.\u00a0 In our example, that&#8217;s <strong>E:\\Program Files (x86)\\7-zip\\7z.exe<\/strong>.\u00a0 Because the path contains spaces, we need to enclose them in double quotes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-883\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess05.png\" alt=\"\" width=\"706\" height=\"162\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess05.png 706w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess05-300x69.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess05-624x143.png 624w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/p>\n<p>After the executable path name,\u00a0 enter the required options for your application.\u00a0 There are 4 tags you can use to represent the exported file to process.\u00a0 Given a file name of <strong>f:\\temp\\exports\\0002_0003.zip<\/strong>:<\/p>\n<ul>\n<li>&lt;FILENAME&gt; returns <strong>f:\\temp\\exports\\0002_0003.zip<\/strong><\/li>\n<li>&lt;FILENAME_PATH&gt; returns <strong>f:\\temp\\exports\\<\/strong><\/li>\n<li>&lt;FILENAME_NOPATH&gt; returns <strong>0002_0003.zip<\/strong><\/li>\n<li>&lt;FILENAME_NOPATH_NOEXT&gt; returns <strong>0002_0003<\/strong><\/li>\n<\/ul>\n<p>In our example, we want to extract the files from our zip archive, so we use the <strong>e<\/strong> option.\u00a0 We then need to provide the archive file name, which we do so using the &lt;FILENAME&gt; tag.\u00a0 Again, we enclose the &lt;FILENAME&gt; tag in double quotes in case it contains spaces.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-884\" src=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess06.png\" alt=\"\" width=\"706\" height=\"162\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess06.png 706w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess06-300x69.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2020\/06\/siv_postprocess06-624x143.png 624w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/p>\n<p>We then want to specify the folder to extract the items into, using the -o option.\u00a0 In this case, we want to extract the files into a subfolder using the zip file name.\u00a0 So given a zip file name of <strong>f:\\temp\\exports\\0002_0003.zip<\/strong>, the contents of that zip file will be extracted into the <strong>f:\\temp\\_dump\\0002_0003<\/strong> folder.<\/p>\n<p>Now after every zip file has been extracted to disk, SQL Image Viewer will run 7-zip to extract the contents of the zip files.<\/p>\n<p>One last option is the <strong>Delete file after successful processing<\/strong> item.\u00a0 Selecting this will cause SQL Image Viewer to delete the exported files if the processing application returns an exit code value of 0.\u00a0 Most command line applications do that.\u00a0 A non-zero exit code usually signifies an error.<\/p>\n<p>We hope you find this option useful.\u00a0 If you want to use an application that requires some parameters using the input file that&#8217;s not provided by any of our tags, drop us a line at <a href=\"mailto:support@yohz.com\">support@yohz.com<\/a>, and we&#8217;ll try to help you out.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fcbkbttn_like \"><fb:like href=\"https:\/\/www.yohz.com\/blogs\/2020\/06\/29\/sql-image-viewer-post-processing-option\/\" action=\"like\" colorscheme=\"light\" layout=\"button\"  size=\"small\"><\/fb:like><\/div><div class=\"fb-share-button  \" data-href=\"https:\/\/www.yohz.com\/blogs\/2020\/06\/29\/sql-image-viewer-post-processing-option\/\" data-type=\"button\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>In SQL Image Viewer 9.10, we added an option to allow you to run an application on each exported file.\u00a0 So say your database contained zip archives, and you use SQL Image Viewer to export those zip archives to disk.\u00a0 Using the post processing option, you can then use your favorite archiver to extract the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[11],"tags":[124,12,123],"_links":{"self":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/877"}],"collection":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/comments?post=877"}],"version-history":[{"count":1,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/877\/revisions"}],"predecessor-version":[{"id":885,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/877\/revisions\/885"}],"wp:attachment":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/media?parent=877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/categories?post=877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/tags?post=877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}