I have a cms that publishes static html pages. When one of those pages
is deleted on the admin side, I want the page to physically delete the
page, and replace it with a nice 404 page.
I started out with what I thought was a simple cffile copy:
<cfset variables.DestFile=request.BasePath & "page_" & client.EditParent
& ".html">
<cffile
action="Copy"
source="#request.ImagePath#404.cfm"
destination="#variables.DestFile#">
That didn't work so I added a cffile delete to get rid of the original
(works fine), then tried copying the file followed by a rename. I'm
doing it in 2 steps as the cf docs don't appear to allow a full filename
in a copy operation.
It still doesn't work. What am I doing wrong? The paths I set in here
are correct, and variables.destfile is correct as the delete operation
works fine.
<cfset variables.DestFile=request.BasePath & "page_" & client.EditParent
& ".html">
<cffile
action="Delete"
file="#variables.DestFile#">
<cffile
action="Copy"
source="#request.ImagePath#404.cfm"
destination="#request.BasePath#">
<cffile
action="Rename"
source="#request.BasePath#404.cfm"
destination="#variables.DestFile#">
--Matt Robertson--
MSB Designs, Inc.
http://mysecretbase.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.