> I've got a project that requires that all images that are
> uploaded are named
> uniquely.  This would usually be a simple case of using the MAKEUNIQUE
> attribute in CFFILE but the client is picky about the names of
> the incoming
> files.  Therefore, the original name must be preserved.  If the desired
> filename already exists on the server, I need to let the user know, and
> rename the file accordingly.  What's the easiest and most efficent way to
> handle this?

Do they have to be names correctly on the server, or just when they are
downloaded back to the client again?  There are different filename two
parameters which would help you do that.  File.ServerFile is the unique name
on the server, but File.ClientFile is the original name of the file before
it was made unique.  You can always store BOTH these names in the DB so that
you can preserve the filename in listings and such in the application.  If a
file is downloaded out of the app, you can also apply the original name back
again to fake out the users into thinking it was always named that on the
server.

If they actually need it to be named correctly on the server itself (boy
that is picky), then you'll want to read up no the NAMECONFLICT="Error"
attribute of the CFFILE tag.  You should be able to use this along with
CFTRY/CFCASE to handle the error and give the user some options on renaming
it.

-Cameron

--------------------
Cameron Childress
ElliptIQ Inc.
p.770.460.7277.232
f.770.460.0963

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to