Solved

How can I use CFFILE and make my upload unique?

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server specifications for web hosting 7 96
Configure a Local PHP Interpreter for Phpstorm 2 438
Nameserver and MX Record 2 81
Stream live video from Raspberry Pi camera 22 264
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 …
What You Need to Know when Searching for a Webhost Provider
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

696 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