On Jan 28, 2008 10:44 AM, Chad Gray <[EMAIL PROTECTED]> wrote:
>
> I am trying to use cffile action=rename to rename some files on the server.
>
> Is there any way to keep it from over-writing existing files that already 
> have the name?
>
> For example I set the tag up like this:
>
> <cffile action="rename"
>         source="c:\test\foo.jpg"
>         destination="c:\test\moo.jpg">
>
> Now in C:\test there is already a file called moo.jpg.
>
> CFFile over writes moo.jpg when it renames foo.jpg.  I want it to throw an 
> error so I can capture it and notify the user that a file already exists with 
> that file name and they need to select a new one.
>
> This is on CF7 not 8.  According to the docs you don't have a "nameconflict" 
> attribute when doing a rename.
>
> <cffile
>    action = "rename"
>    destination = "pathname"
>    source = "full pathname"
>    attributes = "file attributes list"
>    mode = "mode">

wow.  i didn't realize there wasn't a nameconflict attribute in a rename.

you could always do a <cfif not filexists(...)> do your rename
<cfelse> alert user that the filename already exists </cfif>.

-- 
Evelyn the dog, having undergone further modification pondered the
significance of short-person behaviour in pedal depressed,
pan-chromatic resonance, and other highly ambient domains. "Arf," she
said.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297589
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