Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

<cffile> and MAKEUNIQUE

Posted on 2010-09-08
3
Medium Priority
?
462 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 1000 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 1000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

618 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