{"id":464,"date":"2011-03-28T16:16:33","date_gmt":"2011-03-28T20:16:33","guid":{"rendered":"http:\/\/erics-test-lab.com\/?p=464"},"modified":"2011-03-28T16:16:33","modified_gmt":"2011-03-28T20:16:33","slug":"cffile-action-failure-check-the-directory-path","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2011\/03\/cffile-action-failure-check-the-directory-path\/","title":{"rendered":"CFFILE action failure &#8211; check the directory path"},"content":{"rendered":"<p>Encountered an interesting error today after move from CF8 to CF9<\/p>\n<p>the following code produces a path for a directory in which you can use CFFILE actions<\/p>\n<p><code>&lt;cfset thisPath=ExpandPath(\"\/\")&gt;<br \/>\n&lt;cfset thisDirectory=GetDirectoryFromPath(thisPath)&gt;<br \/>\n&lt;cfset RootPath=\"#thisDirectory#\"&gt;<\/code><\/p>\n<p>However you need to output the rootPath to see if it contains an ending slash or not.<br \/>\nExample we had a data\/files\/ directory where we wanted to store uploads.<\/p>\n<p>so outputing our RootPath + data\/files\/  used to give us<br \/>\n<em>Ipaddress\/\/production\/CF\/application\/data\/files\/<\/em><\/p>\n<p>but after the change to CF9 the root path contained its own ending slash so we ended up with<br \/>\n<em>Ipaddress\/\/production\/CF\/application\/\/data\/files\/<\/em><\/p>\n<p>Notice the extra slash before data.  This makes renaming files or moving them impossible. So if your rename or delete isn&#8217;t working, try checking your path&#8217;s final character.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Encountered an interesting error today after move from CF8 to CF9 the following code produces a path for a directory in which you can use CFFILE actions &lt;cfset thisPath=ExpandPath(&#8220;\/&#8221;)&gt; &lt;cfset thisDirectory=GetDirectoryFromPath(thisPath)&gt; &lt;cfset RootPath=&#8221;#thisDirectory#&#8221;&gt; However you need to output the rootPath &hellip; <a href=\"https:\/\/www.esearing.com\/v2010\/2011\/03\/cffile-action-failure-check-the-directory-path\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-464","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=464"}],"version-history":[{"count":0,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/464\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}