Here is a basic cffile upload with makeUnique:
<cffile action = "upload"
destination = "#session.exploc#"
fileField = "form.theupload"
mode = '666'
accept = 'html'
strict = 'true'
result = 'ss'
nameConflict = "makeUnique">
When I upload a file with the same name as an existing file, I am able to pick up the new name this way:
<cfset name = ss.ServerFileName>
I uploaded the file worl1.html several times and got names worl,worl12,worl13, etc. Then I logged out of the application and came back a bit later.
When I again uploaded worl1.html I got an error saying the the file worl12 already exists. So evidently makeUnique only checks once, and does not check for subsequent versions of this file.
Coding around this seems like a pain. I would have to upload each file to a dummy location, then check myself if it exists in the real location and rename it if necessary. Then I'll have to remove the file from the dummy location in case the next one is a conflict.
Can anyone suggest a way to solve this problem simply without a lot of extra code. At the least I need to trap the error and give the user a message he can understand. But trapping the actual problem and fixing it would be better. I need it to work in ColdFusion 10, but it would be nice if it also works in Lucee.