> 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.
Rick's answer is basically correct. You don't need to retain the original filename within the file system, just within the database. Just rename the file to some pseudo-random string (that's what the NAMECONFLICT="MAKEUNQUE" attribute of CFFILE ACTION="UPLOAD" does), then store the original name and other metadata in the database. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Training: Adobe/Google/Paperthin Certified Partners http://training.figleaf.com/ WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers! http://www.webmaniacsconference.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:298209 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

