I won't pretend to speak for Adobe - but the thinking MAY have been -
with the upload action, you have no idea what the file is - therefore
name conflicts may occur more often. With a copy you _do_ know the
file.

As a general FYI, I'm sure you know there are multiple ways to handle
this problem yourself. You can use a UUID-based file name, which is
ugly, but unique, or if you can't copy over foo.txt because it exists,
try foo1, foo2, fooN until it doesn't exist.

On 9/19/07, Brad Wood <[EMAIL PROTECTED]> wrote:
> 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:288831
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to