?
Solved

How can I use CFFILE and make my upload unique?

Posted on 2002-05-20
3
Medium Priority
?
172 Views
Last Modified: 2013-12-24
I am familiar with the MakeUnique function within CFFILE, however, I would like to set the format of the renaming of the "like" files, instead of CF doing it.
 
An example of what I want to do when the file exist:

From this:  test_testing_v1.doc
To: test_testing_v2.doc

As you see, I wish to change just the last number before the ".doc" to increment to the next number.

How would you suggest I do this?
0
Comment
Question by:g118481
[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
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Yog earned 200 total points
ID: 7022633
#1
instead of makeunique, make it overwrite
check if file exists ( ),
 if exists then change the file name
else
 just upload

maybe you can generate a number from sequel identity

but why do you wanna do this..?

#2
keep it Makeunique and store the file names uploaded in a DB along with corresponding records if any or in a new table.

later run a schedule job which cleans up the filenames (if any name not readable), by checking each characters - alphanumeric or numeric blah blah if you want a decent name
0
 
LVL 1

Author Comment

by:g118481
ID: 7022805
Yog,

I'm trying to do this in order to get better control over the naming convention my group uses when uploading documents to our repository.

Is there not a way I can check for the existence of the file name, and if it does, rename it using the format I mentioned above?

I like the attribute of "MakeUnique", however, I know my group will complain that the unique name is nothing like the filename they uploaded.
0
 
LVL 5

Expert Comment

by:Yog
ID: 7024674
yeah you are right, you can always cheque for MakeUnique and if it exists rename files and keep uploading blah blah ...

0

Featured Post

Limited time offer using promo code EXPERTS25

Designed with a wealth of functionality and convenience, ATEN's new Thunderbolt™ 2 Sharing Switch takes your Thunderbolt setup to the next level. Now through August 31, 2017, Experts Exchange members get 25% off the US7220 on the ATEN USA eShop using promo code EXPERTS25.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

800 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