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

FileExists problems

Community Beginner ,
Apr 26, 2013 Apr 26, 2013

Copy link to clipboard

Copied

I am trying to do test to see if a file is in a specific file folder location and if the file exists then it displays the icon to download it.  Here is the code I have so far and I just need a little help to get it going. The part #queryObj2.Video_path# is just part of a query that returns a name in the video_path.  Thanks.

CODE:

<cfset yourFile = "../download/files/powerpoints/"&#queryObj2.Video_path#&".pptx">

<cfif FileExists(yourFile)>

    <p>Your file exists in this directory. You entered the correct filename</p>

</cfif>

Views

556

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

correct answers 1 Correct answer

LEGEND , Apr 26, 2013 Apr 26, 2013

I might be mistaken, but I believe that CFFILE requires the full physical path; relative paths do not work.  C:\CF9\wwwroot\path\to\file\#queryObj2.Video_path# or the like.

^_^

Votes

Translate

Translate
LEGEND ,
Apr 26, 2013 Apr 26, 2013

Copy link to clipboard

Copied

I might be mistaken, but I believe that CFFILE requires the full physical path; relative paths do not work.  C:\CF9\wwwroot\path\to\file\#queryObj2.Video_path# or the like.

^_^

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
Community Beginner ,
Apr 26, 2013 Apr 26, 2013

Copy link to clipboard

Copied

LATEST

Thats it thank you so much. 

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