Do this:
<cfoutput>
<cfset unique="UID" & #Round(RandRange(0,2000000))#>
<!--- Need a check for dupes here --->
<cfif NOT DirectoryExistis(#request.hardpath##unique#)>
<cfdirectory action="create" directory="#request.hardpath##unique#">
</cfif>
<cffile action="UPLOAD" accept="application/*,text/*"
filefield="uploadfile1" nameconflict="MAKEUNIQUE"
destination="#request.hardpath##unique#">
</cfoutput>
I'm a bit confused on why you think you need to enclose this in <cfoutput>
though.
Fred
----- Original Message -----
From: "Greg Zentkovich" <[EMAIL PROTECTED]>
To: "Fusebox" <[EMAIL PROTECTED]>
Sent: Thursday, February 01, 2001 1:31 PM
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