Solved

How can I use CFFILE and make my upload unique?

Posted on 2002-05-20
3
169 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 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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

695 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