Why not use the makeunique option in the CFFILE tag? That way, if CF detects a file with the same name, it renames it automatically. Then you grab the serverfile name and enter that into the database.
Bruce Rick Sanders wrote: > Hi Rick, > > It doesn't solve the problem though. Here's the problem: > > 1. User #1 uploads a file called "Movie.wmv". The file is uploaded to > site/videos/Movie.wmv. The file is referenced in the database in the video > file field " Movie.wmv ". > 2. User #55 also uploads a file called "Movie.wmv" which is a totally > different video in a totally different category. But, because it's named the > same, it overwrites the original "Movie.wmv" file, thus making both videos > the same. > > I need to check to see if the file exists before it's uploaded, or it'll > overwrite the existing video. > > My work-around is to upload the file to a temp location then check if the > file exists already. If not, move the file to the videos folder. If it does > exists, delete it from temp and return an error. > > Kind regards, > > Rick > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298208 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

