Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Renaming a file to date and time after unziped

New Here ,
Mar 17, 2010 Mar 17, 2010

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.

479
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Mar 17, 2010 Mar 17, 2010

<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.

Translate
Valorous Hero ,
Mar 17, 2010 Mar 17, 2010

The <cffile action="rename"...> is what I would look at using.

http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_f_09.html#1098668

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 17, 2010 Mar 17, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 17, 2010 Mar 17, 2010
LATEST

<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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources