Solved

<cffile> and MAKEUNIQUE

Posted on 2010-09-08
3
446 Views
Last Modified: 2012-05-10
I am backing up a database at the end of each day and want to accumulate the backups - not overwrite the current database with the new one. The database name is OFFICE.mdb.
However, the overwrite is still operating and I do not get my accumulation . Office.mdb, Office_1.mdb, Office_2.mdb etc... (Note, I do not need to have the identifiers _1, _2 etc - any identifier which coldfusion wishes to use would be fine.)

I am using coldfusion 8 developer edition with windows XP.

Have attached the code.

Many thanks for any help
<cffile action = "copy"  nameconflict="MAKEUNIQUE"
source = "C:\ColdFusion8\wwwroot\office_11\database\office.mdb" 

destination = "G:\DATABASE_BACKUP\"
>

Open in new window

0
Comment
Question by:jameskane
3 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 250 total points
ID: 33625169
MakeUnique only works with action="upload".  You'll have to write your own routine for creating unique file names, or use an existing function like CreateUniqueFileName() at cflib.org

http://www.cflib.org/udf/createUniqueFileName
0
 
LVL 13

Assisted Solution

by:ansudhindra
ansudhindra earned 250 total points
ID: 33625178
Hi, nameconflict attribute does not applies to "Copy" action.

You need to programatically browse the destination directory and make the existing file name unique and then copy the new file.
0
 

Author Closing Comment

by:jameskane
ID: 33625368
Thanks very much. That's sorted it !!

James
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now