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

Upload issues

Participant ,
Jun 25, 2008 Jun 25, 2008
Okay this is driving me nuts. I haven't had to do file uploads (using cffile) in several years that I have forgotten how I accomplished this before.

Currently I have a form in a subfolder called "fails" which is directly under my root (wwwroot/fails). All I want to do is send any files uploaded to a subfolder called "data" (wwwroot/fails/data). I know I need to set the path in the destination field, but I do not want to hard code the actual path (c:\cfusion8\...). I remember there being a variable that would show me the relative path of a file, but I forgot was that was called (I thought it was a CGI variable but none of them worked).

Any help will be appreciated.
278
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

LEGEND , Jun 25, 2008 Jun 25, 2008
Not variables -- functions.

This now varies by CF version. For the latest and greatest CF 8 I now
use this (Just wrote this a minute ago).

#getDirectoryFromPath(getCurrentTemplatePath())#

Check the system functions in your documentation if you have an older CF
server.

Translate
LEGEND ,
Jun 25, 2008 Jun 25, 2008
Not variables -- functions.

This now varies by CF version. For the latest and greatest CF 8 I now
use this (Just wrote this a minute ago).

#getDirectoryFromPath(getCurrentTemplatePath())#

Check the system functions in your documentation if you have an older CF
server.

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
Participant ,
Jun 25, 2008 Jun 25, 2008
LATEST
Just found it in my CFWACK book. Similar to what Ian said. Here is another slight variation:

#getDirectoryFromPath(ExpandPath("*.*"))#
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