Copy link to clipboard
Copied
I have a google earth kmz that is downloaded to our root directory. I am wanting to see how to rename this file after it is droped into our directory. Here is what I have so far.
<cfif FileExists("#expandpath(".")#/temp.zip")>
Got it .... extract....<br />
<cfzip action="unzip" file="#expandpath(".")#/temp.zip"
destination="#expandpath(".")#"
overwrite="true">
</cfzip>
Right now the code above unzips the file and places the KMZ in the root drive. I wanted to rename the file the current date like as follows RT_2010_03_17_12_00.kmz
I have no idea how to accomplish this.
<cfdirectory...> would probably help you find what the dynamic name of the file is.
dateformat() should help you create a date string in the desired format to use to rename the file.
Copy link to clipboard
Copied
The <cffile action="rename"...> is what I would look at using.
http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_f_09.html#1098668
Copy link to clipboard
Copied
Yep, I guess I don't know where to place the code and what to change to make it change to a date/time/year file because it errors out. Right now I cannot even get it to chage its name. The file comes in an it has a unique name.
Copy link to clipboard
Copied
<cfdirectory...> would probably help you find what the dynamic name of the file is.
dateformat() should help you create a date string in the desired format to use to rename the file.