Solved

<cffile> and MAKEUNIQUE

Posted on 2010-09-08
3
445 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

12 Experts available now in Live!

Get 1:1 Help Now