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

cfimage variable

Explorer ,
May 12, 2009 May 12, 2009

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"

672
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
Valorous Hero ,
May 12, 2009 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

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
Explorer ,
May 12, 2009 May 12, 2009

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

Thanks

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
Valorous Hero ,
May 12, 2009 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

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
Community Beginner ,
May 14, 2009 May 14, 2009
LATEST

Hulfy, did you get this working? What (I think) cfsearching is saying (and from what I understand you need to do) simply name your variable to the upload parameter as such:

<cffile destination="#ExpandPath("./images")#" action="upload" nameconflict="overwrite" filefield="#uploadimage#">

<cfset myFile3 = "#myFile.serverFile#">

[ perform any actions such as resizing etc ]

<img src="images/#myFile3#">

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