Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE and renaming duplicates

Status
Not open for further replies.

sknyppy

Programmer
Joined
May 14, 1999
Messages
137
Location
US
Does anyone have a little handy script that will rename an uploaded file if it already exists?

I want to rename it using the original filename and append a deptID to make it unique.

Would this be done using a series of cfcatches?

Thanks,
Dave



 
Hey,

give this a try...

<cfset File=#form.file#>

<CFIF FileExists(#File#)>
<CFFILE ACTION=&quot;Rename&quot;
source=&quot;#File#&quot;
destination=&quot;#File##deptID#&quot;>
</cfif>

good luck!

AP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top