Solved

How can I use CFFILE and make my upload unique?

Posted on 2002-05-20
3
164 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
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Yog earned 50 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

20 Experts available now in Live!

Get 1:1 Help Now