Skip to main content
Known Participant
May 12, 2009
Question

cfimage variable

  • May 12, 2009
  • 1 reply
  • 737 views

I am trying to get info for my uploaded variable. Live docs tells me that source can be

source = "absolute pathname|pathname relative to the web root|URL|#cfimage variable#"


How do I set
my uploaded file to  a #cfimage variable#?

Below is what I have but does not work.

<cffile action="upload" nameconflict="overwrite" destination="#ExpandPath("./images")#"
filefield="FORM.uploadImage" result="myFile" />

<cfimage action = "info" source = "#myFile#" structname = "myFile3"

    This topic has been closed for replies.

    1 reply

    Inspiring
    May 12, 2009

    The result #myFile# is a structure of information about the uploaded file, not a string.  You need to use some of the values in that structure.  Read the documentation on cffile for a list of the structure contents.

    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_f_10.html#3540091

    HulfyAuthor
    Known Participant
    May 12, 2009

    Not helped me still struggling to create a cfimage variable that points to the file.

    Thanks

    Inspiring
    May 12, 2009

    The following file upload status parameters are available after an upload:


    resultName.serverDirectory - Directory of the file saved on the server
    resultName.serverFile - Filename of the file saved on the server

    ie

    #myFile.serverDirectory#

    #myFile.serverFile#

    You use those values to construct the file path for cfimage