So, I admittedly haven't used cffile that much in the past-just here and there. I was fiddling with something today and came to a startling revelation (which I'm sure most of you already know):
You can't use the nameconflict attribute with action="copy". Well you can-it's simply ignored. I was like, "WTF, over?" I made my usual assumption that there is a REALLY good reason and I just didn't know what it was-- so I Googled for a while hoping to uncover this eye-opening gem of truth. Yeah, nothing. Absolutely nothing. Oh, there's a Livedocs comment here and there where someone mentions it, and SEVERAL code examples where people illegally tried to use nameconflict with action="copy", but nowhere did I find any explanation of WHY copying files always overwrites destination files of the same name. The benefit of being able to control name conflicts when copying files seems so obvious. I mean, how dare CF assume I wish to always overwrite when copying? :-) And then they tease me by having a nameconflict attribute which only works for upload. Yes, yes, I am familiar with fileexists() and all that, but I use CF to make things easier not harder. What's worse, is no error is thrown when you try to use nameconflict with action="copy". Have you ever accidentally typed something like: <cfloop collection="#url#" item="i" index="j"></cfloop> Whoa, big error message in your face. But no-not with cffile. It just silently ignores the nameconflict attribute leading you to believe its being used. So please fill me in. Is there some underlying reason why copy always overwrites, or have enough people simply not requested the enhancement? ~Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288813 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4