Get File Location and store in Field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ndeeley
    New Member
    • Mar 2007
    • 139

    Get File Location and store in Field

    Hi,

    I've created a form that allows the user to upload an attachment.

    I can save the attachment with <cffile> and create a directory (if none exists) with <cfdirectory> . However, I want to save the absolute filepath to a database field so I can use it as a hyperlink later.

    I've tried to concatenate the directory path with a trimmed version of the form.UploadFile field contents, but it doesn't seem to work as I get back a c:.TMP file name instead of that which was actually uploaded.

    Any ideas how I pull the location of the uploaded file back to a database?

    thanks
    neil
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use cffile.serverFi le.

    Note that cffile might be named differently if you specified a value for the 'result' attribute.

    Comment

    • ndeeley
      New Member
      • Mar 2007
      • 139

      #3
      That works brilliantly, thanks for your help acoder!

      Comment

      Working...