Use DirectoryExists(absolute path)

-Alan

-----Original Message-----
From: Greg Zentkovich [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 01, 2001 11:31 AM
To: Fusebox
Subject: Check for dupes...Problem


Does anybody know how to check for duplicate directory names?


If it helps...
I'm creating unique directories using a random number that is associated
with a user. Which all their uploaded
files will be dump into. What I am trying to figure out is how to check is
the directory already exists, if it
does, then skip the "create directory" section and just upload more files...


---------------------snip-----------------------------------------------

<cfoutput>
<cfset unique="UID" & #Round(RandRange(0,2000000))#>

<!--- Need a check for dupes here --->
<cfdirectory action="create" directory="#request.hardpath##unique#">

<cffile action="UPLOAD"
                accept="application/*,text/*"
                filefield="uploadfile1"
                nameconflict="MAKEUNIQUE"
                destination="#request.hardpath##unique#">
</cfoutput>

---------------------snip-----------------------------------------------

if a directory(name) does not already exists
        create one
otherwise just upload files into existing...


Hope this makes sense...

Greg Z
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to