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

cffile delete

Guest
Apr 07, 2007 Apr 07, 2007

Copy link to clipboard

Copied

hi i have a cfile deletewhich works on a schedule task, when there is no file there i get an error,

is there a way of using cfif to determine if the file is present ?

ie if file is present, run delete code

TOPICS
Advanced techniques

Views

254

Translate

Translate

Report

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
LEGEND ,
Apr 07, 2007 Apr 07, 2007

Copy link to clipboard

Copied

<cfif fileexists(fullpathtofile)>

you can get fullpathtofile, which has to be ABSOLUTE path, with
#expandpath("relativepathtofile")#
--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Votes

Translate

Translate

Report

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
LEGEND ,
Apr 07, 2007 Apr 07, 2007

Copy link to clipboard

Copied

LATEST
Cold fusion has an isDefined function. I'm not sure, they might even have an isFile function.

Or, you could use cftry/cfcatch.

Votes

Translate

Translate

Report

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
Documentation